NEW
Font size
WorksheetsIntroduction to JavaScript
Total questions: 20
Worksheet time: 15mins
Which of the following is not a number data type in JavaScript?
-50
20.04
-1292.38101
"123"
How do comments look like in JavaScript?
//
@@
&&
**
Can you change the value of a const?
Yes
No
How many options can a boolean variable have?
1
2
3
4
Can variables change their type in JavaScript?
Yes
No
Which of the following is an invalid string?
"Hello"
`Hello`
"Hello'
'Hello'
What is the index of the letter G in 'VIBGYOR'?
1
2
3
4
Which string method makes text uppercase in JavaScript?
.toUpperCase()
.TOUPPERCASE()
.UpperCase()
.ToUpperCase()
What does the string method .trim() do?
Removes all text
Removes all whitespace
Removes a specific part of the text
Replaces whitespaces
What is the output of "Hello".indexOf('l')
3
4
-1
2
Maximum number of arguments String.slice() method can take in JS?
3
2
1
0
Select the output for 100 + "Hello"
"100Hello"
Error
"100 Hello"
"100+Hello"
Select the output for Hello World + 100
Error
"Hello World100"
"Hello World 100"
"HelloWorld100"
Which of the following is a template literal string?
`Hello`
"Hello"
'Hello'
"${Hello}"
What is the output for: `You bought ${qty} apples` if qty = 5?
"You bought ${qty} apples"
"You bought 5 apples"
Error
"You bought apples"
What is a null variable?
Unknown variable
Variable assigned a value of null
Variable without a name
Variable without a data type
What is an undefined variable?
Variable without a value
Variable assigned a value of null
Variable without a name
Variable without a data type
What is the value of Math.pow(4,6)?
1024
2048
4096
24
Which of the following is a Math.random() output?
0.6625590695007806
1
1.5590695007806
All of the above
What is the output of parseInt('Carat 24 Diamond')?
24
"Carat 24 Diamond"
"24"
NaN
