I am trying the following addition -
arr = ["12","15"];
let sum = arr[0] + 5;
console.log(sum)
It returns me 125 instead of 17. ( because 12 is a string ) I tried to convert this array into an array of numbers by using var string = JSON.stringify(arr).replace (/"/g,''); and then performing the addition but string[0] returns ' [ ' , for the obvious reason.
Is there a direct way to perform this addition?