Before we came to know about map, we were using for loop in cases where we needed to iterate over an array. Now the syntax for that would be something like below: Let us consider an array “arr” with content [22,43,55,32,55,22]; function reduceToHalf() {
var halfArr = []…