Traverse objects and arrays
Traverse the object: for…in loops through the object’s own and inherited enumerable properties Loops through the object’s own and inherited enumerable properties (excluding Symbol properties). 123
Derek Zhu
Traverse the object: for…in loops through the object’s own and inherited enumerable properties Loops through the object’s own and inherited enumerable properties (excluding Symbol properties). 123
Promise.all() and Promise.allSettled() Promise.all and Promise.allSettled are both methods for handling multiple concurrent Promises, but they differ in how they handle successful and failed Promis
Promise: A new solution for asynchronous programming introduced in ES6. Promises are mainly to solve the previous problem of callback hell. Promise is a constructor that encapsulates an asynchronous
Spread operator … (array) The spread operator can split an array or array-like structure into a comma-separated sequence of arguments. 12const arr = [1, 2, 3];console.log(...arr) //result is 1 2 3
Extensions to Functions: Arrow Functions => 123let fn = function(m){return m}; //ordinary functionlet fn = (m) => {return m} //complete writing of arrow functionlet fn
Declares variable a by ‘let’ let is the new way to declare variables in ES6, replacing var. 1234let a;let b, c, d;let e = 100;let f = 521, g = 'iloveyou', h = []; var: allows repeated de