Fix the Bug: Simple Array Manipulation

Published by Werdna in

Help fix all the bugs in the function incrementItems! It is intended to add 1 to every element in the array!

Examples

incrementItems([0, 1, 2, 3]) ➞ [1, 2, 3, 4]

incrementItems([2, 4, 6, 8]) ➞ [3, 5, 7, 9]

incrementItems([-1, -2, -3, -4]) ➞ [0, -1, -2, -3]

Notes

Make sure to read every line carefully.

Watch a quick demo on how Edabit works.