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.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Oh man thats scary, If someone adds another function
getById
later on. Any code which was using oldgetById
would start using newgetById
.To me this sounds like a bug rather than intentional old way of doing things. What do you think it was ?
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.