"use strict";
let arr = readline().split(" "); // suppose inputs are 1 2 3 4 5
let res=0;
for(let i=0; i<arr.length; i++){
res += arr[i];
}
print(res); // output 012345
I know if I iterate through all the array elements and convert them to Number like arr[index] = Number(arr[index]); then I can get rid from this concatenation and will get pure sum.
But is there any way to convert all of these array elements of Strings to Number directly? without any iteration?