The Best Way to Create Functions in JavaScript
There are four ways to define functions in JavaScript: function declaration, function expressions, arrow functions, and Function constructors. Let’s look at all of them and try to find out their pros and cons