Dates, math and useful built-ins
Dates, math and useful built-ins
The Date object represents a point in time; be mindful of time zones when displaying dates. Math provides common numeric functions. Number, String and Array utilities help convert and process values.
Try it yourself
Change the example, run it, and explain the result in your own words. Then create one variation of your own.
Key idea
Use the example as a starting point, not something to memorize. Practise, inspect the result and make small improvements.
Code example
const today = new Date();
const rounded = Math.round(4.7);
console.log(today.toISOString(), rounded);