Please login to start chat

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

reduceRight (JavaScript Array Method)

const tnwNum = [20, 9, 20, 8, 100];

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

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

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

Comments:

No comment to show.

Available Services
Download Android Application