This documentation is also published as Markdown for efficient machine reading: the whole site is indexed at /llms.txt, and every page has a clean Markdown copy at the same URL with .md appended. These are generated from the same source and cost far fewer tokens to read than this rendered HTML.

Skip to main content Skip to navigation
Language

Null

The null keyword represents a value indicating that there is no value.

mew
let text: string = null;

What can be null

A string, an array, any, and a type you declare can hold null. The integer and floating point types, bool and char cannot, so assigning null to one is an error.

mew
let text: string = null;
let items: i32[] = null;
let value: any = null;

An integer, a float, a bool or a char has no such value.

mew
let count: i32 = null;

Null needs a type

null says nothing about the type a variable should have, so a let with only null to go on is an error. Write the type down.

mew
let text = null;
mew
let text: string = null;
Mew is a programming language under construction.