Online Exam Quiz

questionQuestion  1 to 30

What does the reduce() method do in JavaScript?

  • Executes a function once for each array element
  • Returns the first element of an array
  • Reduces the array to a single value
  • Joins two or more arrays
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

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 forEach() method do in JavaScript?

  • Executes a function once for each array element
  • 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 is the output of console.log(+'5')?

  • 5
  • '5'
  • NaN
  • TypeError
Mark for review

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

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

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

  • array
  • object
  • list
  • string
Mark for review

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

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

What does the concat() method do in JavaScript?

  • Joins two or more arrays
  • Splits a string into an array of substrings
  • Reverses the elements of an array
  • Returns the first element of an array
Mark for review

Which keyword is used to declare a variable in JavaScript?

  • var
  • int
  • string
  • let
Mark for review

Which method is used to add elements to the end of an array in JavaScript?

  • push()
  • pop()
  • shift()
  • unshift()
Mark for review

What does DOM stand for?

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

Which function is used to parse a string to JSON in JavaScript?

  • parse()
  • stringify()
  • toJSON()
  • fromJSON()
Mark for review

What does the this keyword refer to in JavaScript?

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

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

  • '25'
  • 25
  • 55
  • 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 typeof(null)?

  • object
  • null
  • undefined
  • function
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('hello'.charAt(0))?

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

Which of the following is not a valid way to create a JavaScript object?

  • var obj = {}
  • var obj = new Object()
  • var obj = ()
  • var obj = []
Mark for review

What will be the output of console.log(0.1 + 0.2 === 0.3)?

  • TRUE
  • FALSE
  • Error
  • NaN
Mark for review

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

  • NaN
  • number
  • undefined
  • Error
Mark for review

Which function is used to find the maximum value in an array in JavaScript?

  • max()
  • maximum()
  • Math.max()
  • Array.max()
Mark for review

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

  • undefined
  • null
  • NaN
  • undefined
Mark for review

Which function is used to round a number to the nearest integer in JavaScript?

  • ceil()
  • round()
  • floor()
  • trunc()
Mark for review

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

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

What does the filter() method do in JavaScript?

  • Returns the first element of an array
  • Returns a new array with elements that pass a test
  • Returns the last element of an array
  • Returns a new array with the length of the elements
Mark for review

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

  • TRUE
  • FALSE
  • TypeError
  • undefined
Mark for review

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

  • 1
  • 2
  • 3
  • -1
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