Photo by Arnold Francisca on Unsplash
4 key JavaScript Concepts for Web Development
IIFE, Scope, Closures, and Hoisting
JavaScript is a type of computer language that helps make web pages come to life! It's one of the most popular languages and is used on almost all websites.
As a web developer, there are four important concepts to understand.
IIFE
Also called an Immediately Invoked Function Expression is like a secret code that is run right away and can't be accessed from outside. This helps keep everything in its own private space and not make a mess in the bigger space where it lives.
Scope
The scope is like a box that keeps things separate. It's important to understand what's inside and outside of the box to make sure everything works correctly.
Closures
They are like a secret code within a secret code. It's a way to share information between the two without making a mess in the bigger space.
Hoisting
Don't confuse this hosting, it's "HOIST" ing, so the hosting is used when JavaScript moves things to the top of the code before running it. This can sometimes cause confusion, so it's important to understand how it works.