From the creator of NodeBook, a thorough guide to Node's internals, comes a scroll-driven visualization following every step a single HTTP POST request takes from the user's click to Node's event loop and on to a database behind it.
Ishtmeet Singh
Please open Telegram to view this post
VIEW IN TELEGRAM
❤1👍1🔥1
CHALLENGE
const primArr = [1, 2, 3];
const copyArr = [...primArr];
copyArr[0] = 99;
const objArr = [{ x: 1 }, { x: 2 }];
const copyObjArr = [...objArr];
copyObjArr[0].x = 99;
console.log(primArr[0], copyArr[0], objArr[0].x, copyObjArr[0].x);
CHALLENGE
const arr = [1, [2, 3], [4, [5, 6]], 7];
const a = arr.flat();
const b = arr.flat(2);
const c = arr.flatMap(x => Array.isArray(x) ? x : [x, x]);
const d = [1, 2, 3].flatMap(x => [[x]]);
console.log(JSON.stringify([a, b, c, d]));
What is the output?
Anonymous Quiz
23%
[[1,2,3,4,[5,6],7],[1,2,3,4,5,6,7],[1,1,2,3,4,[5,6],7,7],[1,2,3]]
39%
[[1,2,3,4,[5,6],7],[1,2,3,4,5,6,7],[1,1,2,3,4,[5,6],7,7],[[1],[2],[3]]]
34%
[[1,2,3,4,5,6,7],[1,2,3,4,5,6,7],[1,1,2,3,4,[5,6],7,7],[[1],[2],[3]]]
4%
[[1,2,3,4,[5,6],7],[1,2,3,4,5,6,7],[1,1,2,3,4,5,6,7,7],[[1],[2],[3]]]
👍1