const is a good practice for both readability and maintainability and avoids using magic literals e.g.

    1. if (x > 10) {
    2. // Better!
    3. if (x > maxRows) {
    4. }

    const declarations must be initialized

    Left hand side of assignment cannot be a constant

    Constants are immutable after creation, so if you try to assign them to a new value it is a compiler error:

    1. const foo = 123;

    Block Scoped

    A const is block scoped like we saw with let:

    Deep immutability

    1. foo = { bar: 456 }; // ERROR : Left hand side of an assignment expression cannot be a constant

    However it still allows sub properties of objects to be mutated, as shown below:

    For this reason I recommend using const with primitives or immutable data structures.