ECMAScript 5.1 introduced a number of operations on an Array, including map, filter and reduce. These functions empower JavaScript developers to replace the classic for loop with some neat functional programming alternatives. Given an array arr = [1, 2, 3], where you used to write var total = 0; for…