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

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

Examples

1
const hello = 'hi'
Copied!

Usage

1
const Title = <h1>Learn React</h1>
Copied!

References