Q. What will be the output of the following JavaScript code?
Code:
<script>
var values = [10, 20, 30, 40];
var result = values.reduceRight(function(x,y){
return (x + y);
});
document.write("Result: " + result);
</script>
β
Correct Answer: (D)
Result: 100