Javascript Array And Array Operations Cpp Payment