Skip to content

JavaScript has 7 primitive types #31

@wisammechano

Description

@wisammechano

In most textbooks and at MDN it is mentioned that JavaScript has 7 primitive types. However, in this lesson, we say there are 3.

JavaScript has three primitive types -- `string`, `number`, `boolean` -- and they are present in TypeScript as well. You can declare them just as you would in JavaScript. However, in TypeScript, you may _optionally_ add a type. As mentioned previously, in most cases TypeScript can infer the type correctly.

I understand the authors meaning for the example but we may need to adjust the wording.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions