How are regular functions and function expressions different in JavaScript?
I’ve been asked this question countless times during mentorship meetings, meetup networking sessions and forums. – What is the difference between assigning an anonymous function to a variable and a regular function? To know this difference the only requirement is to know how hoisting works in JavaScript. TL;DR – Hoisting The main difference between a function expression and a regular function is the following: Regular functions are hoisted to the top of the scope, with their full body whilst function expressions are hoisted like regular variables. Read more