Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Current »

const is useful because it binds the variable to a name and means you cannot re-assign it. So you can do this:

const DAYS_WEEKEND = ["Saturday", "Sunday"];
DAYS_WEEKEND = [1,2,3];  // One cannot re-assign a const variable.

This code is following a popular convention of putting constants in capitals - as often used in C.

  • No labels