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
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
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
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
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
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
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