Search Header Logo

JavaScript Numbers and Strings – MCQs

Authored by Dheepan G

Information Technology (IT)

Professional Development

Used 2+ times

JavaScript Numbers and Strings – MCQs
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

30 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of the following code?

let x = 10;

let y = "5";

console.log(x + y);

15

105

10 + 5

Error

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following methods converts a number to a string?

toNumber()

toText()

toString()

parseInt()

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output?

console.log(Number("123"));

"123"

123

NaN

undefined

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of:

console.log(parseInt("12.34"));

12.34

12

13

NaN

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which method converts a number into an exponential notation?

toExponential()

toPrecision()

toFixed()

toLocaleString()

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of:

console.log(isNaN("Hello"));

true

false

"Hello"

NaN

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of:

console.log((0.1 + 0.2).toFixed(2));

0.3

"0.30"

0.30

"0.3"

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Microsoft

Continue with Microsoft

or continue with

Facebook

Facebook

Apple

Apple

Others

Others

By signing up, you agree to our Terms of Service & Privacy Policy

Already have an account?