let g=0;
let a={};
let f=()=>{
if(g===1){a.h=2;};
g++;
return a;}
console.log(f()===f());
the output comes true. Since after first function call to f() we changed a by adding h , it still shows them equal. can anyone explain why?
Blancer.com Tutorials and projects
Freelance Projects, Design and Programming Tutorials
let g=0;
let a={};
let f=()=>{
if(g===1){a.h=2;};
g++;
return a;}
console.log(f()===f());
the output comes true. Since after first function call to f() we changed a by adding h , it still shows them equal. can anyone explain why?