Online Exam Quiz

questionQuestion  1 to 30

What does the this keyword refer to in JavaScript?

  • Global object
  • Current object
  • Parent object
  • No specific object
Mark for review

What will be the output of console.log(2 + '2')?

  • 4
  • '22'
  • '4'
  • NaN
Mark for review

What is the output of console.log('5' - 3)?

  • '53'
  • '2'
  • 2
  • TypeError
Mark for review

What does DOM stand for?

  • Document Object Model
  • Document Order Model
  • Document Organization Model
  • Dynamic Object Manipulation
Mark for review

What will be the output of console.log(typeof([]))?

  • array
  • object
  • list
  • string
Mark for review

Which of the following is a correct way to create an array in JavaScript?

  • var arr = {}
  • var arr = []
  • var arr = ()
  • var arr = <>
Mark for review

What is the result of console.log(undefined == null)?

  • TRUE
  • FALSE
  • TypeError
  • undefined
Mark for review

How do you declare a function in JavaScript?

  • def function_name():
  • function function_name()
  • function_name():
  • function function_name{}
Mark for review

What is the result of 3 === '3'?

  • TRUE
  • FALSE
  • Error
  • NaN
Mark for review

What does the splice() method do in JavaScript?

  • Adds or removes elements from an array
  • Returns a new array with elements that pass a test
  • Reverses the elements of an array
  • Joins two or more arrays
Mark for review

What does the typeof operator return when used with an array?

  • object
  • array
  • list
  • number
Mark for review

What is the result of console.log(0 == false)?

  • TRUE
  • FALSE
  • Error
  • NaN
Mark for review

What is the result of console.log(typeof(NaN))?

  • NaN
  • number
  • undefined
  • Error
Mark for review

What is the result of console.log('5' === 5)?

  • TRUE
  • FALSE
  • Error
  • NaN
Mark for review

What is the result of console.log(Boolean(''))?

  • TRUE
  • FALSE
  • TypeError
  • undefined
Mark for review

What will be the output of typeof(null)?

  • object
  • null
  • undefined
  • function
Mark for review

Which function is used to convert a string to uppercase in JavaScript?

  • toUpperCase()
  • upperCase()
  • toUpper()
  • uppercase()
Mark for review

What will be the output of console.log([1, 2, 3].indexOf(2))?

  • 1
  • 2
  • 3
  • -1
Mark for review

What is the output of console.log(5 * '5')?

  • '25'
  • 25
  • 55
  • TypeError
Mark for review

What is the result of console.log(!'hello')?

  • TRUE
  • FALSE
  • TypeError
  • undefined
Mark for review

Which of the following is not a looping structure in JavaScript?

  • for
  • while
  • loop
  • do...while
Mark for review

What is the result of console.log(1 + 2 + '3')?

  • 6
  • '123'
  • '33'
  • TypeError
Mark for review

Which method is used to remove the last element from an array in JavaScript?

  • pop()
  • shift()
  • slice()
  • splice()
Mark for review

What will be the output of console.log('hello'.toUpperCase())?

  • 'hello'
  • 'HELLO'
  • 'h'
  • TypeError
Mark for review

What is the result of 5 == '5'?

  • TRUE
  • FALSE
  • Error
  • NaN
Mark for review

What is the output of console.log(5 + true)?

  • 6
  • 5true
  • 1
  • TypeError
Mark for review

What does the isNaN() function do in JavaScript?

  • Checks if a value is not a number
  • Checks if a value is a number
  • Checks if a value is negative
  • Checks if a value is infinite
Mark for review

What will be the output of console.log(2 * 'two')?

  • 2
  • 'two'
  • NaN
  • TypeError
Mark for review

What is the purpose of the break statement in JavaScript?

  • To exit a loop
  • To skip the current iteration of a loop
  • To continue to the next iteration of a loop
  • To halt the execution of a function
Mark for review

Which function is used to execute a function after a specified number of milliseconds in JavaScript?

  • setDelay()
  • setTimeout()
  • delay()
  • wait()
Mark for review

blinkerOnline

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • Answered
  • Not Answered
  • Marked for Review