what is const in javascript

index.tsx
const is used in JavaScript to declare a constant variable that cannot be reassigned or redeclared. It provides a way to create a read-only reference to a value.
 
Example:
const PI = 3.14159;
PI = 3; // This will result in an error because you cannot reassign a constant variable
281 chars
6 lines

related categories

gistlibby LogSnag