Articles in this series
Below is an example. const obj1 = {}; const obj2 = { k: 2 }; function fn({ k = 1 }) { console.log(k); } fn(obj1); // 1 fn(obj2); // 2
let a = {}; a?.k1 = 1; If you run the above example, you will meet this error in Chrome. Invalid left-hand side in assignment I think it should...
Concept Please check the codes below. function fn({ k1 = 1 }) { return k1; } console.log(fn('Put whatever you want here.')); The conclusion of the...
Problem In an async function, there can be many Promise instances. In this situation, if a former one throws an error, then the latter one is not...
Below is the example. // string const o1 = {}; o1['k1'] = 'v1'; const o1k1 = Object.keys(o1)[0]; console.log('o1k1', o1k1, typeof o1k1); // o1k1 k1...
0. Introduction 0-1. Greeting I think one of the trickiest parts of JavaScript is 'this' keyword because it depends on various situations. So, let me...