jskatas.org Continuously Learn JavaScript. Your Way.

Block scope: const declaration

const is like let plus read-only.

Donate to NGO Julenka. Support Ukranians in need. Julenka is an NGO which my brother founded in 2011 to support Ukranian families and kids in need.

const is like let plus read-only

  • const scope leaks too

scalar values are read-only

  • e.g. a number
  • or a string

complex types are NOT fully read-only

  • array`s items can be changed
  • object`s can be modified