WorksheetsIMSD_Week-5_CSE-1
Total questions: 10
Worksheet time: 5mins
Which keyword is used to define a constant in JavaScript?
let
const
var
constant
Which of the following is not a JavaScript data type?
Undefined
Number
Boolean
Character
What will be the output of:
console.log(2 + '2');
4
22
NaN
undefined
Which of the following functions displays a message in a dialog box?
prompt()
alert()
display()
message()
How do you write a function in JavaScript?
function:myFunc(){}
function = myFunc(){}
function myFunc(){}
def myFunc()
Which method converts a string to an integer in JavaScript?
parseString()
stringToInt()
parseInt()
toInteger()
Which of the following is the correct syntax to output data to the console?
print("Hello");
log.console("Hello");
console.log("Hello");
echo("Hello");
Which method can be used to convert a string to lowercase?
toLowerCase()
lowerCase()
convertLower()
caseLower()
What is the default value of an uninitialized variable in JavaScript?
null
undefined
0
empty
What is the purpose of the return statement in a function?
Terminates a loop
Ends function and returns a value
Jumps to another function
Exits program
