Dec 14, 2022
Make the function a const
const myFunction = function(test) { console.log(test); }
or when you can get away with arrow:
const myFunction = (test) => console.log(test);
And it'll scope. You've probably been seeing more and more people writing their functions this way... that's why.