Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
October 19, 2021 07:10 am GMT

Variables Comparison JS

var -> Var can be re-assigned, re-defined and has a function-scope. When we declared outside the function, it has a global scope and it attached itself to the window object.

let -> Let can be re-assigned. Its scope is within a block of code.

const -> Const cannot be re-assigned or re-defined. Its scope is within a block of code.


Original Link: https://dev.to/sudharshan24/variables-comparison-js-472

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To