📜

JavaScript: Core Concepts

76 cards · 🇺🇸 English

Core JavaScript language fundamentals.

Study all 76 cards for free

Flashcards, quizzes, pixel-art games and a daily review that remembers for you.

Study this deck free

Try the first 10 cards

1 / 10
Question

Seven primitive types in JavaScript

Knew itLearning

Tap the card for the answer · swipe right if you knew it, left if not

Already have an account? Sign in

Cards

  1. 1Seven primitive types in JavaScript
    Number, BigInt, String, Boolean, Symbol, Undefined, Null
  2. 2Number type in JavaScript
    IEEE 754 64-bit double-precision floating point value (no distinction between int and float)
  3. 3BigInt
    Arbitrarily large integers (specified with an 'n' suffix: 100n)
  4. 4Result of 3 / 2 in JavaScript
    1.5 (not 1, unlike some languages)
  5. 5NaN
    Not a Number - returned from invalid math operations. NaN is contagious: any operation with NaN returns NaN
  6. 6Is NaN equal to itself?
    No, NaN is the only value in JavaScript that's not equal to itself (per IEEE 754)
  7. 7Dividing by zero
    Infinity (positive or negative)
  8. 8Are strings in JavaScript Unicode?
    Yes, they are UTF-16 encoded sequences of Unicode characters
  9. 9Can strings use single or double quotes?
    Both work - JavaScript does not distinguish between characters and strings
  10. 10Template literals in JavaScript
    Strings with embedded expressions using backticks: `I am ${age} years old.`
  11. 11Null
    A deliberate non-value (only accessible through the null keyword)
  12. 12Undefined
    Absence of value (e.g., uninitialized variables, nonexistent properties, return with no value)
  13. 13What values are falsy in JavaScript?
    false, 0, empty strings (''), NaN, null, and undefined
  14. 14Three keywords to declare variables
    let, const, and var
  15. 15Let
    Declaring block-level variables (available from the block they're enclosed in)
  16. 16Const
    Declaring variables whose values are never intended to change (block-scoped, cannot be reassigned)
  17. 17Does const prevent mutations?
    No, it only prevents reassignments. For objects: obj.a = 1 is allowed even if obj is const
  18. 18Why is var discouraged?
    It has surprising behaviors (e.g., not block-scoped) and is discouraged in modern JavaScript
  19. 19Value of an uninitialized variable
    undefined
  20. 20Temporal dead zone
    The region where let/const variables occupy the scope but cannot be accessed before declaration
  21. 21Is JavaScript statically or dynamically typed?
    Dynamically typed - types are associated with values, not variables
  22. 22+ operator
    String concatenation - when one operand is a string, everything is converted to string first
  23. 23'3' + 4 + 5
    '345' (string concatenation from left to right)
  24. 24== vs ===
    == performs type coercion, === (strict equality) does not. === is usually preferred
  25. 25123 == '123'
    true (type coercion)
  26. 26Are && and || short-circuit operators?
    Yes - they evaluate left to right and stop as soon as the outcome is determined
  27. 270 && 'Hello'
    0 (first falsy value)
  28. 28'Hello' || 'world'
    'Hello' (first truthy value)
  29. 29Walrus operator in JavaScript
    := - allows assignment inside expressions
  30. 30Are semicolons required in JavaScript?
    Optional - JavaScript automatically inserts them (ASI), but there are caveats

And 46 more cards. Study the whole deck free

Articles about this deck

More Programming decks

See all
Study all 76 cards free