You can also create one without using any of let, var, and const if you're not in strict mode
You should mention that this is an antipattern.
Also, when you declare a function you're creating a variable since a function is just a value in JS and can be overridden.
What's interesting about this is that functions are block-scoped so technically JS had block-scoped variables before ES2015.
You should mention that this is an antipattern.
Also, when you declare a
function
you're creating a variable since a function is just a value in JS and can be overridden.What's interesting about this is that functions are block-scoped so technically JS had block-scoped variables before ES2015.
ok