Please login to start chat

ICT Solutions 12 Jun 2022, 15:49:16
Category : JavaScript Tutorials

reduce (JavaScript Array Method)

const tnwNum = [70, 30, 20, 10, 7];

function tnwFun1(){
document.getElementById("demo").innerHTML = tnwNum.join("
");
}

function tnwFun2(){
var result = tnwNum.reduce(tnwFun3);
document.getElementById("demo").innerHTML = result;
}

function tnwFun3(leftNum, sum){
return leftNum - sum;
}

Comments:

No comment to show.

Available Services
Download Android Application