Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function mutate(arr) {
- for (let i = arr.length; i--; i >= 0) {
- if (arr[i].type === 'potato') {
- arr.splice(i, 1);
- } else if (arr[i].type === 'apple') {
- arr[i].price = arr[i].price * 2;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment