Syntax

TypeScript Basic Primitive Types Syntax

In TypeScript, basic primitive types: the built-in primitive types — string, number, boolean, bigint, symbol, null, undefined

Quick Answer

Syntax
string, number, boolean, bigint, symbol, null, undefined
TypeScriptSyntax

Basic Primitive Types

Code example
string, number, boolean, bigint, symbol, null, undefined

The built-in primitive types.

Learn More

How to basic primitive types in TypeScript

  1. Open your TypeScript file or editor.
  2. Copy the example, then replace its sample names and values for your code.

TypeScript Basic Primitive Types Syntax

Use string, number, boolean, bigint, symbol, null, undefined.

Related Syntax References

Frequently asked questions

What is the TypeScript syntax for basic primitive types?

Use this pattern: string, number, boolean, bigint, symbol, null, undefined

Can I copy this TypeScript code example?

Yes. Use Copy code and adapt the example to your program.

Is this TypeScript syntax different on Mac or Windows?

No. The language syntax is the same across operating systems.

Official source · How we verify