Javascript Replace Element In Array With Division Of Motor