Block Scope II


#1

Is something wrong with the code?

I was asked to create an if statement, i leave the link here: https://www.codecademy.com/courses/learn-javascript-scope/lessons/scope/exercises/block-scope-ii?action=resume_content_item&course_redirect=introduction-to-javascript

is about the instruction number 3, and here is my code:


const visibleLightWaves = () => {
  let lightWaves = 'Moonlight';
  let region = 'The Arctic';
  if (region === 'The Arctic');{}
  console.log(lightWaves);
}

visibleLightWaves();

#2

look at the example:

if (dusk) {

do you see a semi-colon between ) and {? Placing a semi-colon where you did, will interrupt the if clause, preventing the if clause from ever executing, your if clause is also empty


#3

Ohhh, i didn’t notice it before, thanks!


#4

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.