ES6+ for React
  • Introduction
  • Introduction
    • Introduction
  • Statements and declarations
    • let
    • const
    • class
    • import
    • export
  • Standard built-in objects
    • Arrow functions
    • Template literals
    • Array.prototype.map()
    • Computed property names
  • Expressions and operators
    • Spread operator
    • Destructuring assignment
    • Logical Operators
Powered by GitBook
On this page
  • Defination
  • Syntax
  • Examples
  • Usage
  • References

Was this helpful?

  1. Statements and declarations

const

PreviousletNextclass

Last updated 4 years ago

Was this helpful?

Defination

Constants are block-scoped, much like variables defined using the let statement. The value of a constant cannot change through re-assignment, and it can't be redeclared.

Syntax

const name1 = value1 [, name2 = value2 [, ... [, nameN = valueN]]];

Examples

const hello = 'hi'

Usage

const Title = <h1>Learn React</h1>

References

MDN const