var currentAge = 26;
var maxAge = 100;
var amountPerDay = 30.50;
var calculation = (((maxAge - currentAge) * 365) * amountPerDay);
console.log(calculation);
var stringCalc = calculation.toString().split('').splice(2, 0, "9");
console.log(stringCalc);
console.log(stringCalc) shows an empty array. Does this have something to do with the toString method?
Note: I am trying to add the string "9" into the middle of the array, not remove anything from the array.
.split()returns an array+operator in JavaScript, aren't you? Your code looks like it is for a write-code-that-is-impossible-to-read contest ;)