Answers for "Function declaration bad and good"

0

Function declaration bad and good

// bad
if (currentUser) {
  function test() {
    console.log('Nope.');
  }
}

// good
let test;
if (currentUser) {
  test = () => {
    console.log('Yup.');
  };
}
Posted by: Guest on June-09-2021

Code answers related to "Function declaration bad and good"

Code answers related to "Javascript"

Browse Popular Code Answers by Language