0
why is this code giving the answer 5
const t = { val: 2 }; const c1 = () => t.val +=1; const c2 = () => t.val *=2; c2(); c1(); console.log(t.val);
1 Antwort
+ 1
Steve Nawa 🇳🇦
c2() = t.val = t.val * 2 = 2 * 2 = 4
c1() = t.val = t.val + 1 = 4 + 1 = 5