LearnFrenzy
Sign in Take a free test

Data Types · Exercise 1 of 4

Data Types JavaScript Data Types MCQ

  • 15 questions
  • Page 2 of 2
  • Answers explained
0Attempted
0Correct
0Wrong
Directions

Fifteen multiple-choice questions on JavaScript data types: primitives and objects, typeof, number precision, NaN, BigInt, null and undefined, falsy values, symbols and value vs reference. Pick an option to check your answer instantly.

Question 11 Medium

After let s = "code"; s.toUpperCase(); what is the value of s?

A "code" – string methods return a new string and never change the original
B "CODE"
C undefined
D A String object
Question page & discussion
Question 12 Medium

Why is { id: 1 } === { id: 1 } false?

A === converts objects to strings first
B Object literals are always unequal to themselves
C Because id is a number
D === on objects compares references, and these are two different objects
Question page & discussion
Question 13 Medium

Which statement about Symbol("id") is correct?

A Every call creates a unique value, even with the same description
B Two symbols with the same description are equal
C Symbols are a kind of string
D Symbols can be created with new Symbol()
Question page & discussion
Question 14 Easy

How does JavaScript store values of the number type?

A As 32-bit integers, with floats stored separately
B As exact decimal fractions
C As 64-bit IEEE 754 double-precision floating-point values
D As strings of digits
Question page & discussion
Question 15 Hard

Strings are primitives, yet "abc".length and "abc".toUpperCase() work. Why?

A Strings are secretly objects in JavaScript
B length is a global function
C String literals are converted to arrays
D The engine temporarily wraps the primitive in a String object to look up the property (autoboxing)
Question page & discussion
Up next · Exercise 2Predict the Output20 questions

Ready to test your Programming?

Timed online tests with instant scores and explanations.

Search LearnFrenzy

Esc

Quick links