JavaScript Numbers

Last Updated :
Discuss
Comments

Question 1

What is the result of typeof 123 in JavaScript?

  • A

    number

  • B

    integer

  • C

    string

  • D

    undefined

Question 2

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

  • A

    parseInt()

  • B

    parseString()

  • C

    toNumber()

  • D

    convertToNumber()

Question 3

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

  • A

    isInt()

  • B

    isInteger()

  • C

    isNumber()

  • D

    checkInteger()

Question 4

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

  • A

    10

  • B

    20

  • C

    30

  • D

    NaN

Question 5

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

  • A

    true

  • B

    false

  • C

    NaN

  • D

    undefined

Question 6

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

  • A

    *

  • B

    /

  • C

    %

  • D

    //

Question 7

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

  • A

    3.9

  • B

    3

  • C

    4

  • D

    NaN

Question 8

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

  • A

    .toString()

  • B

    .toNumber()

  • C

    .convert()

  • D

    .toInt()

Question 9

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

  • A

    123

  • B

    NaN

  • C

    '123'

  • D

    undefined

Question 10

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

  • A

    isValidNumber()

  • B

    isNaN()

  • C

    checkNumber()

  • D

    isNum()

There are 10 questions to complete.

Take a part in the ongoing discussion