본문 바로가기

JAVASCRIPT

scope 예문

const logVisibleLightWaves = () => {

  let lightWaves = 'Moonlight';

  let region = 'The Arctic';

  // Add if statement here:

  if(region==='The Arctic'){

    let lightWaves = "Northern Lights"

    console.log(lightWaves);

  };

  

  console.log(lightWaves);

};

 

logVisibleLightWaves();

'JAVASCRIPT' 카테고리의 다른 글

The .forEach() Method  (0) 2020.06.14
중첩 for 문 예시  (0) 2020.06.09
es6 좀더 간결한 표현  (0) 2020.06.08
삼항연산자 예문 추가  (0) 2020.06.05
자바스크립트 짝수로 표현  (0) 2020.05.19