hat
Syntax arr.reduce(callbackFunction, [initialValue]) Ki sa ki diminye fè? Diminye se yon fonksyon ki pasan nan yon etalaj. Operasyon Ou kapab fè sou etalaj la atravè yon fonksyon kalbak. Nan fen a nan operasyon yo sou etalaj la, reduce returns a single value Reduce can be used, pa egzanp, to total a shopping cart Example let arr…
eng
Syntax arr.reduce(callbackFunction, [initialValue]) What does reduce do? Reduce is a function that loops through an array. Operations can be performed on the array via a callback function. At the end of the operations on the array, reduce returns a single value Reduce can be used, for example, to total a shopping cart Example let arr…