# var, let and constant in Js

By [Ukoeka](https://paragraph.com/@ukoeka) · 2024-01-10

---

JS simply means Javascript by the way

`var`, `let`, and `const` are all keywords used for declaring variables in JavaScript, but they differ in terms of scope, reassignment, and immutability.

`var` are function-scoped or globally-scoped, which means they are accessible within the function they are declared in, or globally if declared outside a function.

`let` allows for block-scoped variable declaration. Variables declared with `let` are limited in scope to the block, statement, or expression in which they are used. `let` also allows reassignment but not redeclaration within the same scope.

`const` is used to declare variables that are block-scoped like `let`, but their values cannot be reassigned once they are initialized. However, it's important to note that while the value itself cannot be reassigned, for objects and arrays declared with `const`, their internal properties or elements can still be changed.  
  
I will drop examples in the next post, drop questions or comments  
Thanks

---

*Originally published on [Ukoeka](https://paragraph.com/@ukoeka/var-let-and-constant-in-js)*
