Thursday, September 29, 2022
HomeWordPress DevelopmentFundamentals of let, const, var 🚀

Fundamentals of let, const, var 🚀


Variables: Variables in JavaScript are containers for storing information. JavaScript permits the utilization of variables within the following 3 ways:

var:

var is essentially the most generally used variable in JavaScript. It may be initialized to a worth, redeclared and its worth could be reassigned, however solely contained in the context of a perform. It may be perform scoped or globally scoped.

using var

let:

let in JavaScript is just like var solely distinction lies within the scope. var is perform scoped, let is block scoped. It can’t be redeclared however could be reassigned a worth.

Using let

const:

const in JavaScript is used to declare a set worth that can not be modified over time as soon as declared. They will neither be redeclared nor be reassigned. They can’t be hoisted both.

Using const

📢Join with me on LinkedIn🚀

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments