Variables, Types & Collections Flashcards
Method to flatten an array (depth 0+ or infinity for entire array)
.flat(depth)
.flat(Infinity) / .flat(1) / .flat(0)
Static array method to create an array from an array like collection
Array.from(arrayLikeCollection)
Create an array from arguments provided
Array.of(arguments)
Creates an array of the length specified by the argument
Array constructor
Which date methods can be used to display the time in the Coordinated Universal Time (UTC) zone?
toUTCString() provides a more human-readable format
and
toISOString()
Which date method returns the time in the users time zone with a plus or minus offset relation to UTC?
toString()
Which date method returns only the date portion and not the time?
toDateString()
How many falsy values are there in JavaScript and what are they?
There are 8 falsy values and they are false, 0, -0, 0n, ‘’ (empty string), null, undefined, and NaN (Not a Number).