
Broken npm packages often fail due to small packaging mistakes. This guide shows how to use Publint to validate exports, entry points, and module formats before publishing.

Discover what’s new in The Replay, LogRocket’s newsletter for dev and engineering leaders, in the February 11th issue.

Cut React LCP from 28s to ~1s with a four-phase framework covering bundle analysis, React optimizations, SSR, and asset/image tuning.

Rich Harris (creator of Svelte) joined PodRocket this week to unpack his Performance Now talk, Fine Grained Everything.
Hey there, want to help make our blog better?
Join LogRocket’s Content Advisory Board. You’ll help inform the type of content we create and get access to exclusive meetups, social accreditation, and swag.
Sign up now
3 Replies to "Demystifying function and variable hoisting in JavaScript"
Nice article
Thanks for the compliment.
Hi, You said Function hoisting supersedes variable hoisting.
Why is it then the variable declation var name = ‘gbolahan’;
is still higher than the function myName() ?
Isn’t supposedly in this order?
myName(){}
var name = undefined;
name = ‘gbolahan’