PNL Learn

JavaScript Built-ins and Data

Numbers, strings, arrays, Map, Set, dates, JSON and regex.

Real programs spend most of their time shaping data, and JavaScript ships the tools built in. You will parse and round numbers without floating point surprises, keep money in cents and format it with Intl, work with strings through padding, splitting, replacing and locale-aware sorting, and use every major array method, including sort with a comparator and reduce with a starting value. Then you will choose between objects, Map and Set for lookups, counts and groups, build and format dates in UTC, move data through JSON with replacers and revivers, write regular expressions with flags and named groups, and finish with iterators and generators in a sales report, an activity summary, a log parser and a paginator. Each lesson calls out where JavaScript differs from the Python you may already know.

IntermediateJavaScript7 lessons84 exercisesAbout 5.5 h
Create a free account

What you will learn

  • Numbers and Math
  • Money in cents
  • String methods
  • Array methods
  • Map and Set
  • Dates and JSON
  • Regular expressions
  • Iterators and generators

Lessons

  1. 1

    Numbers and Math

    Parse numbers out of text with a radix, test for NaN and whole numbers, compare decimals safely, keep money in cents, round, use Math and random ranges, and format currency with Intl.

    13 exercises

  2. 2

    Strings in Depth

    Trim and pad text, read from the end with at, split with a limit and join, replace every match, ask startsWith and endsWith, sort names with localeCompare, and count characters the way UTF-16 does.

    12 exercises

  3. 3

    Arrays in Depth

    Choose splice or slice, merge with spread, destructure with defaults, search with find, some and every, build pipelines with map, filter and reduce, and sort numbers and records correctly.

    12 exercises

  4. 4

    Map, Set and Objects as Dictionaries

    Keep unique values and compare groups with Set, look things up by any key with Map, know when an object's keys turn into strings, group and count records, and attach data to objects with WeakMap.

    11 exercises

  5. 5

    Dates and JSON

    Build dates with zero-based months, read and set their parts, measure elapsed time, keep UTC and local time apart, format dates with Intl, and move data through JSON with replacers, indents and revivers.

    12 exercises

  6. 6

    Regular Expressions

    Write regex literals and RegExp objects with flags, validate with anchored patterns, extract data with exec, match, matchAll and named groups, replace with groups or a function, and avoid the lastIndex and greedy traps.

    12 exercises

  7. 7

    Iterators, Generators and Putting It Together

    Make your own objects iterable with Symbol.iterator, write generators that pause at yield, know why extending built-in prototypes is risky, and combine the course in a sales report, an activity summary, a log parser and a paginator.

    12 exercises

How you practice

You practice in the browser and every exercise gives you feedback right away. This course uses these formats:

  • Code exercise: 40
  • Fix the bug: 15
  • Predict the output: 14
  • Type the answer: 5
  • Fill in the blank: 4
  • Multiple choice: 3
  • Match the pairs: 2
  • Select all that apply: 1

Aligned to

CS2023ACM / IEEE-CS / AAAISource
  • Software Development Fundamentals
    • SDF-FundamentalsFundamental Programming Concepts and Practices
    • SDF-Data-StructuresFundamental Data Structures
JSA-41-01: Certified Associate JavaScript ProgrammerJS InstituteSource
  • Built-in Objects
    • 3.1Number
    • 3.2String
    • 3.3Date
    • 3.4Arrays
    • 3.5Advanced array methods
    • 3.6Set
    • 3.7Map
    • 3.8Objects as dictionaries
    • 3.9JSON
    • 3.10Math
    • 3.11Regular expressions
    • 3.12Extending built-in types
  • Advanced Functions
    • 4.5Generators and iterators
MDN Curriculum (core)MozillaSource
  • JavaScript fundamentals
    • 6.2Math
    • 6.3Text
    • 6.4Arrays
    • 6.13Working with JSON

Proto Node Labs is not affiliated with or endorsed by ACM / IEEE-CS / AAAI, JS Institute and Mozilla. Exam names are trademarks of their owners.