Free Online Flashcard Deck

03 Types and Data Representation Free Online FlashCards

Study 03 Types and Data Representation with 12 free online flashcards. Review key terms, definitions, and concepts with this interactive flashcard deck.

12 cards
01
Front

What does a data type describe?

Back

A data type describes what kind of value a program uses and which operations are valid for that value.

02
Front

What is a primitive value?

Back

Primitive values are single, immutable values, such as numbers, strings, Booleans, undefined, null, bigints, and symbols.

03
Front

How do object variables differ from primitive variables?

Back

Objects are reference values: variables hold references to objects, so assigning one object variable to another can make both names refer to the same object.

04
Front

What limitation does a shallow object copy have?

Back

A shallow copy copies an object's top-level properties, but nested objects or arrays may remain shared between the original and the copy.

05
Front

What is explicit type conversion?

Back

Explicit conversion is requested by the programmer, such as Number(text), String(value), Boolean(value), or parseFloat(text).

06
Front

What is implicit conversion?

Back

Implicit conversion, or coercion, happens automatically. For example, if one operand of + is a string, JavaScript performs string concatenation.

07
Front

What does NaN represent?

Back

NaN is a special numeric value indicating an unsuccessful numeric result, such as Number("not a number").

08
Front

How do === and == differ?

Back

The === operator checks strict equality without ordinary type conversion, while == permits type conversion before comparing.

09
Front

How should JavaScript code check for null?

Back

typeof null returns "object" because of a historical JavaScript behavior. Test for null directly with value === null.

10
Front

How can code identify an array reliably?

Back

Use Array.isArray(value) to distinguish an array from other objects, because typeof an array returns "object".

11
Front

What are two important properties of JavaScript strings?

Back

JavaScript strings are immutable, zero-indexed sequences of text. String methods return new strings instead of changing the original.

12
Front

How should arrays, objects, sets, and maps be chosen?

Back

Use an array for an ordered sequence, an object for named fields, a set for unique values, and a map for key-value lookup.