106 Replies
so if I type
hello
it would produce oellh
?no it just produces hello
![No description](https://cdn.answeroverflow.com/1249007323691880489/image.png)
it should produce this yes
right
so lets break it down
we need to be able to get the first and the last character, and "the middle"
then we just combine them
do you know how to get the first character?
did i not get it by doing word[0]
yep!
what about the last?
i used the for loop
that seems silly, doesnt it?
i tried to google it
we only need the last - why would we just a loop
would it be
word[word.length]
idk
yeah that works
there is a better way to do the same thing thou
word[^1]
the ^
means "start from the end"![No description](https://cdn.answeroverflow.com/1249008709636587600/image.png)
do i not need to convert it to an array