Skip to content

React

Reference pages are ideal for outlining how things work in terse and clear terms. Less concerned with telling a story or addressing a specific use case, they should give a comprehensive outline of what you’re documenting.

Further reading

const
const hi: "Hello"
hi
= 'Hello'
const msg = `${
const hi: "Hello"
hi
}, world`
const msg: "Hello, world"
var console: Console
console
.
Console.log(...data: any[]): void
log
((1 + 2 + 3 + 4).to
Number.toFixed(fractionDigits?: number): string

Returns a string representing a number in fixed-point notation.

@paramfractionDigits Number of digits after the decimal point. Must be in the range 0 - 20, inclusive.

Fixed
(2))
toExponential
toFixed
toLocaleString
toPrecision
toString
/** A Basic Todo interface*/
interface
interface Todo

A Basic Todo interface

Todo
{
Todo.title: string
title
: string;
}
const
const todo: Readonly<Todo>
todo
:
type Readonly<T> = { readonly [P in keyof T]: T[P]; }

Make all properties in T readonly

Readonly
<
interface Todo

A Basic Todo interface

Todo
> = {
title: 'Delete inactive users',
title: string
}
const todo: Readonly<Todo>
todo
.title = 'Hello'
Error ts(2540) ― Cannot assign to 'title' because it is a read-only property.
Installing dependencies…
npm install
my-test-file.js
console.log('Hello World!');
// my-test-file2.js
console.log('Hello World!');
my-test-file.js
console.log('Hello World!');