Spell It Backwards
JavaScript
10 pts
Spell It Backwards
The string word is iterable. Use that twice:
- Create
letters, an array of the letters, withArray.from(word). - Create
let reversed = "";and build the word backwards with afor…ofloop overword: put each new letter in front ofreversed.
Print letters, then reversed. Expected output:
[ "A", "s", "m", "a", "r", "a" ] aramsA
Checklist
- Create
letterswithArray.from(word). - Build
reversedwith afor…ofloop overword. - Print
lettersandreversed.
🔑 Solution
If you view the solution before passing, you earn half points for this exercise. You still need to type it and press Check to finish.
How it works, step by step
Point at a step to highlight its lines. Type the solution yourself and press Check answer to finish.
