Given an array of numbers, remove all numbers that don't increase in value from the previous. Return a new array.
// input:
const a = [1, 2, 2, 3, 2, 4, 5]
// output:
[1, 2, 3, 4, 5]
(Ctrl + ')
Loading...
/* output */
Next(Ctrl + y)
Given an array of numbers, remove all numbers that don't increase in value from the previous. Return a new array.
// input:
const a = [1, 2, 2, 3, 2, 4, 5]
// output:
[1, 2, 3, 4, 5]
/* output */