🏜️ Word Flip Canyon
Pull the magical levers to reverse the order of words
Load Words
📜 Original Sentence
1
Split by spaces
2
Reverse word list
3
Join with spaces
FLIP!
🔄 Reversed Sentence
Reset
Step by Step
Auto Flip
✨ Final Result
-
🔮 Word Reversal Algorithm
function
reverseWords
(s):
words = s.split(
" "
)
// Split by spaces
words.reverse()
// Reverse the array
return
words.join(
" "
)
// Join back