The instructor assigns Boron two tasks (regarding the use of reduce() method after lecturing in array methods).
calculateSum() that takes a string and returns the sum of the ASCII values of all the characters in the string using reduce().reverseString() that reverses and returns an input string using reduce().While solving the problem, Boron has encountered errors. Help him fix the errors.
calculateSum("lime") ➞ 423
// 108 + 105 + 109 + 101 = 423
calculateSum("a") ➞ 97
// a = 97
reverseString("hello") ➞ "olleh"
N/A