JavaScript Declarations and Assignments Declaring and initializing constants

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Insert
> Step 2: And Like the video. BONUS: You can also share it!

Example

You can initialize a constant by using the const keyword.

const foo = 100;
const bar = false;
const person = { name: "John" };
const fun = function () = { /* ... */ };
const arrowFun = () => /* ... */ ;

Important
You must declare and initialize a constant in the same statement.



Got any JavaScript Question?