Do you know the answer to this tricky javascript interview problem about objects and their properties? Even if you correctly guess the answer, do watch till the end because I also talk about a new and cool ES6 feature related to the same problem. If ...
Markdown supported · ⌘↵ to post
Biplab Malakar
Question: 1
a = [1,2,3,4]; a['abc']="5"; a.length =0; console.log(a[2]);// ? console.log(a.abc);// ?Question: 2
a = {a: 1, b: 2, c: null, d: undefined}; b = JSON.parse(JSON.stringify(a)); console.log(b);//?Question: 3
//Write code such that, if I write a = [...10] //Now if I print a, then output should be console.log(a);//[1,2,3,4,5,6,7,8,9,10]