Solved mth to last element, js