This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// COMMON OPERATIONS ON ARRAYS: | |
// CREATE A NEW VARIABLE | |
// Array.map => create a new array from an existing array. Each return is a new element of the new array | |
// Array.filter => create a new array: keeps elements when return true, removes elements when return false | |
// Array.reduce => create something new (number, string, object, array...) from an existing array. return adds things to the accumulator (acc) | |
// EXECUTE SIDE EFFECTS | |
// Array.foreach => Do stuff with each array item (it does not return anything) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Asynchronous JavaScript basics | |
// Asynchronous programming is a way to execute code | |
// without blocking the execution of the rest of the program. | |
// We commonly use the asynchronous syntax when we need to | |
// => Get data from another website or API | |
// => Retrieving / storing data in a database | |
// => Write / Read files from file system |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const subUser = /** @type {SubUserType} */ (/** @type {unknown} */ (user)) |
OlderNewer