Q.1 What will be the output of the following code:
function sum(...a) {
"use strict";
return a[0].reduce((s, val) => s = s + val, 0);
}
console.log(sum([1,2,3,4]))
Q.2 What will happen when you run the following code:
"use strict";
let someVariable;
somVariable = 17;
Q.3 What will be the output of the following code:
function sum(a, a, c) {
return a + a + c;
}
console.log(sum(10, 20, 30))
Q.4 What will be the output of the following code:
"use strict";
const obj = { id: 1, id: 2 };
console.log(obj)
Q.5 What will be the output of the code in strict mode and non strict mode:
var x = 7;
delete x;
console.log(x);