JavaScript strings, numbers, and JSON

JavaScript strings, numbers, type conversion, and JSON

Learn JavaScript strings, string methods, numbers, number formatting, type conversion, object-to-primitive conversion, JSON.parse, JSON.stringify, and toJSON.

String, number, conversion, and JSON lessons

  1. Type conversion

    Convert values between strings, numbers, booleans, and other primitives without surprising coercion bugs.

    Outcome: Choose explicit conversions when JavaScript would otherwise coerce values for you.

    • JavaScript type conversion
    • type coercion JavaScript
    • Boolean conversion
    Study Type Conversions
  2. Object to primitive conversion

    Control how objects become primitives with valueOf, toString, Symbol.toPrimitive, and comparison contexts.

    Outcome: Understand how custom objects participate in string, number, and default conversion.

    • object to primitive JavaScript
    • Symbol.toPrimitive
    • JavaScript valueOf
    Study Object to primitive conversion
  3. Methods of primitives

    Use wrapper behavior around strings, numbers, booleans, symbols, and BigInts without confusing primitives with objects.

    Outcome: Call primitive methods while keeping the primitive/object distinction clear.

    • JavaScript primitive methods
    • methods of primitives
    • wrapper objects JavaScript
    Study Methods of primitives
  4. Numbers

    Work with JavaScript numbers, numeric separators, rounding, precision, parseInt, parseFloat, and number formatting.

    Outcome: Handle numeric input, formatting, rounding, and precision intentionally.

    • JavaScript numbers
    • number methods JavaScript
    • parseInt JavaScript
    Study Numbers
  5. Strings

    Use JavaScript strings, quotes, Unicode, substrings, searching, comparison, and common string methods.

    Outcome: Manipulate text safely across common UI, data, and search workflows.

    • JavaScript strings
    • JavaScript string methods
    • string methods JavaScript
    Study Strings
  6. JSON methods and toJSON

    Serialize and parse structured data with JSON.stringify, JSON.parse, replacers, revivers, and toJSON hooks.

    Outcome: Move data between JavaScript objects, APIs, and storage formats with predictable JSON behavior.

    • JSON JavaScript
    • JSON parse
    • JSON stringify
    Study JSON methods, toJSON