Skip to content
Twoslash Logo

Expressive Code Twoslash

A plugin to add TypeScript Twoslash code examples
console.log((1 + 2 + 3 + 4).to Fixed(2))
toExponential
toFixed
toLocaleString
toPrecision
toString
/** A Basic Todo interface*/
interface Todo {
title: string;
}
const todo: Readonly<Todo> = {
title: 'Delete inactive users',
title: string
}
todo.title = 'Hello'
Error ts(2540) ― Cannot assign to 'title' because it is a read-only property.