Strings, Numbers and Dates
String methods, Unicode and emoji, regular expressions, Math and rounding money, Intl formatting, and dates and time zones without the usual bugs.
Almost every program handles text, numbers and dates: a name typed into a form, a price in a cart, the time an order was placed. This phase teaches the built-in tools JavaScript gives you for each of them, and the traps hidden inside them.
You'll learn the everyday string methods (cutting, searching, splitting, replacing, padding), why an emoji can have a length of 2 or more (Unicode), how to find patterns in text with regular expressions, how Math and rounding work (and why money needs care), how to show numbers and dates the way each country expects with **Intl**, and how the Date object, timestamps and time zones really work.
It builds on Phase 1 (strings and numbers basics) and Phase 3 (functions). Every example is live: change it, press Run, and compare the console with what you predicted. Later, Phase 5 uses many of these methods on arrays, and Hectal's /dsa course uses string tricks in its string problems.
Practise this phase
Hands-on exercises: write the code, see your page live, and press Check to have it tested automatically.