Skip to content

Arrow function

TypeScript arrow + types

Same task in: JavaScript

Flowchart (ISO 5807)

StartInput xReturn x²EndFigure 1 — square

Source code

TypeScript
const square = (x: number): number => x * x;

The editor opens with this code — change it and the chart redraws.

Language
TypeScript
Constructs
arrow + types
Topic
Lambdas
Formats
Word, Visio, draw.io, PDF, SVG

Related examples