Question : 1 What is the result of the following expression: 5 + "3"?
8
53
35
NaN
Question : 2 Which of the following is NOT a valid way to declare a variable in JavaScript?
var x = 5;
let y = 3;
const z = 10;
variable w = 8;
Question : 3 What is the result of the following expression: "20" - 5?
15
25
20
NaN
Question : 4 Which keyword is used to define a function in JavaScript?
function
define
func
funciton
Question : 5 What is the result of the following expression: typeof 42?
number
string
undefined
object
Question : 6 What does the "===" operator do in JavaScript?
Checks for equality without type conversion
Checks for equality with type conversion
Assigns a value to a variable
Compares two variables
Question : 7 What is the output of the following code snippet? ```javascript console.log(1 + "2" + "2"); ```
122
32
1222
5
Question : 8 What is the correct way to write a comment in JavaScript?
//This is a comment
<!--This is a comment-->
#This is a comment
/* This is a comment */
Question : 9 Which built-in method adds one or more elements to the end of an array and returns the new length of the array?
push()
add()
concat()
append()
Question : 10 Which of the following is NOT a valid data type in JavaScript?
number
boolean
character
string
Question : 11 Which of the following is the correct way to declare a JavaScript array?
var colors = {};
var colors = [];
var colors = ();
var colors = "";
Question : 12 What does the "&&" operator do in JavaScript?
Logical OR
Logical AND
Bitwise OR
Bitwise AND
Question : 13 What is the result of the following expression: 5 * "3"?
15
53
35
NaN
Question : 14 Which method is used to remove the last element from an array in JavaScript?
pop()
remove()
delete()
splice()
Question : 15 What is the output of the following code snippet? ```javascript console.log("5" + 3); ```
53
8
15
NaN
Question : 16 Which of the following is NOT a valid JavaScript variable name?
myVar
3var
_var
$var
Question : 17 What is the correct way to round the number 7.25 to the nearest integer in JavaScript?
Math.round(7.25)
round(7.25)
Math.ceil(7.25)
Math.floor(7.25)
Question : 18 What does the "||" operator do in JavaScript?
Logical AND
Bitwise OR
Logical OR
Bitwise AND
Question : 19 What is the result of the following expression: "Hello".length?
Hello
5
undefined
NaN
Question : 20 Which built-in method returns the index of the first occurrence of a specified value in a string?
indexOf()
search()
find()
locate()