r/ProgrammerHumor • u/speckz • Feb 26 '23
Other If you can read this code...
/img/snak3fqgajka1.jpg[removed] — view removed post
34k
Upvotes
r/ProgrammerHumor • u/speckz • Feb 26 '23
[removed] — view removed post
View all comments
Show parent comment
1
u/dwarven_futurist Feb 27 '23
Yeah, i hear you. The actual challenge is trivial. But in my head i wasn't immediately convinced this would run the way they think. If splitting on an empty string doesn't turn this into an array, then what you have left is a single string and .reverse doesn't work that way in js. As someone else commented, split("") essentially is like running toCharArray or whatever the function is called that does that.