Fsr020923 today's practice session

Question 1: What is JavaScript primarily used for?

a) Styling web pages
b) Adding interactivity to web pages
c) Creating web page layouts
d) Sending emails

Question 2: Which keyword is used to declare a variable in JavaScript?

a) var
b) int
c) string
d) variable

Question 3: How do you write a single-line comment in JavaScript?

a)
b) // This is a comment
c) /* This is a comment */
d) ’ This is a comment ’

Question 4: Which of the following is NOT a JavaScript data type?

a) Number
b) Boolean
c) String
d) Character

Question 5: How do you check if two variables have the same value and data type in JavaScript?

a) ==
b) ===
c) =
d) !=

Question 6: Which function is used to display a message in a popup dialog box in JavaScript?

a) alert()
b) console.log()
c) print()
d) prompt()

                                                                                                                             Question 7: How do you assign the value of variable x to variable y in JavaScript using an assignment operator?

a) x → y
b) x = y
c) x => y
d) x == y

                                                                                                                    Question 8: Which operator is used to combine two or more strings in JavaScript?

a) +
b) *
c) -
d) /

                                                                                                                                            Question 9: How do you write a 'for' loop in JavaScript to execute a block of code 5 times?

a) for (i = 1; i <= 5; i++)
b) for (i = 0; i < 5; i++)
c) for (i = 0; i <= 5; i++)
d) for (i = 1; i < 5; i++)

Question 10: How do you check if two variables have different values in JavaScript using a comparison operator?

a) !=
b) ==
c) !==
d) ==!

1 b
2 a
3 b
4 d
5 b
6 a
7 b
8 a
9 a,b
10 b

1 Like

1 b
2 a
3 b
4 d
5 b
6 a
7 b
8 a
9 a and b
10 b

1 Like

1)b 2)a 3)b 4)d 5)b 6)a 7)b 8)a 9)a&b 10)b

1 Like

1-b) Adding interactivity to web pages
2-a) var
3-c) /* This is a comment */
4-d) Character
5-b) ===
6-a) alert()
7-b) x = y
8-a) +
9- b) for (i = 0; i < 5; i++)
10- b) ==

1 Like

1.c) Creating web page layouts
2.a) var
3.b) // This is a comment
4.d) Character
5.b) ===
6.a) alert()
7.b) x = y
8.a) +
9.b) for (i = 0; i < 5; i++)
10.c) !==

1 Like

1.b
2.a
3. b
4.d
5.a
6.a
7.b
8.a
9.both a,b
10.a

1 Like

1.b
2.a
3.b
4.d
5.b
6.a
7.b
8.a
9.a&b
10.b

1 Like