Thank you for the response! I didn’t realize I could write holder that way, and I thought there was a way I could rewrite that to shorten the loop but couldn’t think of it.
It took a while to figure this one out and write it the way and I did. I thought about using charCodeAt when I was almost done but I wanted to try to finish it this way since I had spent the time on it.
I also hadn’t thought too much about readability, I’ve been making them short so it’s easier to type but that’s probably something I should get in the habit of.
Thanks for the response. I see what you mean, I sometimes try to make a comment of an overview of what needs to be done and then do a mental overview of the whole thing when I’m finished. But making longer notes like this would probably help a lot in the learning process, and help if I need to come back to it in the future. I’ll try to do this more, thanks for the advice.
In addition to what has already been mentioned, I would rewrite this as follows:
let ciph = ['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'];
let ciphReversed = [...ciph].reverse();
Note that the .reverse method changes the original array. That’s why you first create a new empty array , then write the values of ciph into it with the ... spread syntax, and finally reverse that new array.