Using arrays and adding up index to create an expression in JS through WebStorm