I seem to be printing out 'Northern Lights' twice, what is wrong here?


#1

Question

I seem to be printing out ‘Northern Lights’ twice, what is wrong here?

Answer

Make sure you’re using let again when you define lightWaves in the scope of your if. This way it doesn’t overwrite lightWaves from the outer scope but rather creates a brand new variable lightWaves for the if statement’s scope!