wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

IMSD_Week-5_CSE-1

Total questions: 10

Worksheet time: 5mins

Name
Class
Date
1.

Which keyword is used to define a constant in JavaScript?

a)

let

b)

const

c)

var

d)

constant

2.

Which of the following is not a JavaScript data type?

a)

Undefined

b)

Number

c)

Boolean

d)

Character

3.

What will be the output of:

console.log(2 + '2');

a)

4

b)

22

c)

NaN

d)

undefined

4.

Which of the following functions displays a message in a dialog box?

a)

prompt()

b)

alert()

c)

display()

d)

message()

5.

How do you write a function in JavaScript?

a)

function:myFunc(){}

b)

function = myFunc(){}

c)

function myFunc(){}

d)

def myFunc()

6.

Which method converts a string to an integer in JavaScript?

a)

parseString()

b)

stringToInt()

c)

parseInt()

d)

toInteger()

7.

Which of the following is the correct syntax to output data to the console?

a)

print("Hello");

b)

log.console("Hello");

c)

console.log("Hello");

d)

echo("Hello");

8.

Which method can be used to convert a string to lowercase?

a)

toLowerCase()

b)

lowerCase()

c)

convertLower()

d)

caseLower()

9.

What is the default value of an uninitialized variable in JavaScript?

a)

null

b)

undefined

c)

0

d)

empty

10.

What is the purpose of the return statement in a function?

a)

Terminates a loop

b)


Ends function and returns a value

c)

Jumps to another function

d)

Exits program