A small Node.js practice exercise that demonstrates how to bounce between strings and character arrays in JavaScript using the classic chain:
str.split('').reverse().join('').split('')— string → array of characters.reverse()— flip the array in place.join('')— array of characters → string
- Decode four reversed messages — each is a backwards inspirational note about learning to code; the script reverses each one back to readable English.
- Encode three of my own messages — three short developer mantras, then run the same chain to produce the reversed (encoded) form.
Prerequisites: Node.js installed.
# from the project root
node index.jsYou should see four Decoded N: lines (the messages now readable forward), followed by three Reversed N: lines (my own messages with their characters in reverse order).