The difference between function
, var
, and let
/const
.
2 min readJan 6, 2020
If you are new to JavaScript, you may see conflicting advice in your learning. There appear to be three different ways to define a function!
function myFunc(){}
var myFunc = function() {};
const myFunc = () => {};
The key difference between these methodologies lies in “hoisting,” which takes a variable defined towards the end of a scope and allows…