exercise 5 of 10
change and search
- c is change: delete what the motion covers, then enter insert mode. cw changes to the end of the word.
- * searches for the word under the cursor; n goes to the next match, N to the previous.
Rename tmp to total. Search, change one, then n. for the rest.
The search wraps around the end of the file.
try it
goal:
let total = 0; for (const n of numbers) total += n; return total;