Output of following code
function magic(...nums){
let sum = 0;
nums.filter(n=>n%2==0).map(el=>sum+=el);
return sum;
}
console.log(magic(1,2,3,4,5,6));
#javascript#javascriptquestion
JavaScript question- if I pass an array to a function with setInterval, and then pop off a member of the array, does it reset when the function is called again? #javascriptquestion
What will be logged in the console after executing this #JavaScript code? Choose the correct option:
A) BLUE
B) RED
C) Uncaught SyntaxError: Unexpected identifier
D) Something else (explain why)
#CodingQuestions#JavaScriptQuestion#LearnToCode