Caesar Cypher Questions(on if clauses or array properties)


I need a bit of help regarding a JS solution of caesar cypher…
I have made locally a JS file which I ran on my pc/web developer option/terminal regarding the case of user input: ‘Aaa’
Check out the code in github/can be executed to ur console

I can’t understand why it’s not behaving as it should=passing the 3 values to the newword[].

My train of thoughts (with bold it’s the array’s name of my code):
1.create an array with 26 small letters alphabetsmall
2.create an array with 26 capital letters alphabetcapital
3.use split to have an array with uses input word
4. search through STEP 3 if the letter is found and if so store it to a new array newword

P.S. I haven’t made the case where the uses enters something other but letters, i will see it in the future (will try something with regular expressions) -ignore lines 35-38-

Thnx in advance for the help I am a bit stuck for the last 2 days on Fundamental JS part 5 :frowning:


Hi AlexandreLeFou,

In fundamentals part 1 we recommend to use const and let but I see in your code that you either user var or nothing at all, creating global variables.

That and other details tells me that you probably moved a bit too fast through the lessons.
Having a shaky foundation will work against you on the long run, exercises will get more tricky than this and it will be impossible to understand them without a solid base.

We could give you the solution to this exercise, but it won’t help you much at this point.

Don’t get discouraged! just be patient and don’t rush.


ok I shall review the 1st lesson and attack it again in a bit.

The main thing that concerns me is that my logic is not rubbish correct?


Hello a small code review please :slight_smile:
Caesar cipher solution

@Javier-Machin for example in this working prototype where should i use const?
as for let as i remember it is a variable that exists for a small scope i.e. for (let i=…) so I think in this version there is not that much use?

Any opinion or/and criticism on the code would be helpful :slight_smile: