const

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

Last updated