It’s Time for Fun Puzzle!
Here I will Share you Some Code Please execute that and reply your answer.
1.What will be the output of the following code?
const x = [1, 2, 3];
x[-1] = -1;
console.log(x[x.indexOf(10000)]);
2.What will be the output of the following code?
console.log(2 + "2" + 2);
3.What will be the output of the following code
const y = 1;
const x = y = typeof x;
console.log(x);
4.What will be the output of the following code?
const a = [1, 2, 3];
const b = [...a, 4];
console.log(b);
5.What will be the output of the following code?
console.log(+"Infinity");
I Hope you will find this useful!
Have a Happy Learning
Thanks & Regards
Teaching Assistant,
Dharshini M.