My guess is that, some devs used function expressions (e.g. var getById = function()...) instead of function declarations (function getById()...)
Function declarations are hoisted with body but function expressions are not, causing people who don't know how hoisting work declare same code over and over sometimes.
Log in to continue
We're a place where coders share, stay up-to-date and grow their careers.
My guess is that, some devs used function expressions (e.g.
var getById = function()...
) instead of function declarations (function getById()...
)Function declarations are hoisted with body but function expressions are not, causing people who don't know how hoisting work declare same code over and over sometimes.