JavaScript Numbers

This section covers the questions for the Numbers in JavaScript to clear all your concepts.

Last Updated :
Discuss
Comments

Question 1

What is the result of typeof 123 in JavaScript?

  • number

  • integer

  • string

  • undefined

Question 2

Which of the following methods is used to convert a string to a number in JavaScript?

  • parseInt()

  • parseString()

  • toNumber()

  • convertToNumber()

Question 3

Which of the following methods is used to check if a number is an integer?

  • isInt()

  • isInteger()

  • isNumber()

  • checkInteger()

Question 4

What will be the result of Math.max(10, 20, 30)?

  • 10

  • 20

  • 30

  • NaN

Question 5

What is the output of 0.1 + 0.2 === 0.3 in JavaScript?

  • true

  • false

  • NaN

  • undefined

Question 6

Which operator is used to get the remainder of a division operation?

  • *

  • /

  • %

  • //

Question 7

What is the output of Math.floor(3.9) in JavaScript?

  • 3.9

  • 3

  • 4

  • NaN

Question 8

Which of the following methods can be used to convert a number into a string in JavaScript?

  • .toString()

  • .toNumber()

  • .convert()

  • .toInt()

Question 9

What is the result of Number('123')?

  • 123

  • NaN

  • '123'

  • undefined

Question 10

Which of the following methods is used to check if a value is a valid number in JavaScript?

  • isValidNumber()

  • isNaN()

  • checkNumber()

  • isNum()

There are 10 questions to complete.

Take a part in the ongoing discussion