Javascript Replace Element In Array With Division 1