Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Practice: Converting Between Strings and Character Arrays

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

What it does

  1. Decode four reversed messages — each is a backwards inspirational note about learning to code; the script reverses each one back to readable English.
  2. Encode three of my own messages — three short developer mantras, then run the same chain to produce the reversed (encoded) form.

How to run

Prerequisites: Node.js installed.

# from the project root
node index.js

You 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).

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages