An Interest In:
Web News this Week
- April 24, 2024
- April 23, 2024
- April 22, 2024
- April 21, 2024
- April 20, 2024
- April 19, 2024
- April 18, 2024
October 19, 2021 07:10 am GMT
Original Link: https://dev.to/sudharshan24/variables-comparison-js-472
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:
Tweet
View Full Article
Dev To
An online community for sharing and discovering great ideas, having debates, and making friendsMore About this Source Visit Dev To