0% found this document useful (0 votes)
6 views

Updated unit test1 css answer

imp css units test

Uploaded by

bagajit888
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

Updated unit test1 css answer

imp css units test

Uploaded by

bagajit888
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Q.

1)
a):
Arithmetic operators:
Arithmetic operators are used to perform basic mathematical calculations.
types:
Addition
Subtraction
Multiplication
Division

Logical Operators:
Logical operators are used to combine conditional statements and perform logical operations.
tuypes:
Logical AND
Logical OR
Logical NOT

b):
Setter:
A setter is a method that sets the value of a specific property. It allows you to execute code when a property
value is set.
Getter:
A setter is a method that sets the value of a specific property. It allows you to execute code when a property
value is set.

c):
A JavaScript function is a block of code designed to perform a particular task.
A JavaScript function is executed when "something" invokes it.

Syntax:
function name(parameter1, parameter2, parameter3)
{
// code to be executed
}

Example:
function myFunction(p1, p2) {
return p1 * p2;
}

d):
constructor
input
length
index
prototype

length := Sets or returns the number of elements in an array.


prototype:= Allows you to add new properties and methods to an Array object.

e):
text components display text and optionally allow the user to edit the text.
Q.2 )
a):
Variables declared in global scope are typically defined outside of any functions or code blocks.

<html>
<body>
<script>
var townMessage = "Welcome our town!";

function Message() {
document.write(townMessage);
}
Message();
</script>
</body>
</html>

b):
1) String
A string data type is a group of characters or textual content enclosed by single quotes (‘ ‘) or double-quotes (”
“), or tick signs (` `).

2) Number
A number data type is a numeric value. It can be an integer (positive or negative), floating-point, or exponential.

3) Boolean
Boolean is a logical data type used to compare two variables or check a condition. It has only two values,
namely, true and false.

4) Undefined
An undefined data type means that a variable is declared and not assigned any value. It is the default value of a
variable that has not been defined.

5) Null
A null value means no value. It means an empty value or absence of value.

6) Symbol
The symbol data type in JavaScript defines a property of an object which is private to the object. The value with
the Symbol data type can be referred to as a symbol value.

c):
description:
The prompt() method displays a dialog box that prompts the user for input.

The prompt() method returns the input value if the user clicks "OK", otherwise it returns null.

Syntax:
let userInput = prompt(message, defaultInput);

Example:
let userName = prompt("Please enter your name:", “Abdul Raheman”);
if (userName !== null) {
console.log(“ Welcome to our website !.”);
}
d):
<html>
<body>
<script>
let sum=0
for(i=1;i<=100;i++)
{
if(i%2==0)
{
sum=sum+i
}
}
document.write(sum)
</script>
</body>
</html>

You might also like