Data Types In JavaScript

There are six different data types in JavaScript: Strings, integers, floats (decimal numbers), Boolean, null (which is “None” in Python), undefined and Symbol.

Strings

Strings are words (or numbers) that are surrounded by quotation marks (“”).

Here’s an example of one in JavaScript:

const name = "Zende";

As you can see, the word Zende is the string because it has quotes around it.

Output:

*the variable const is used so that we can’t change the value of the variable. if we were to try to change the value of name, we would get an error message say we’re not allowed.

Numbers

Here’s an example of an integer:

const age = 16;

And example of a float:

const temp = 98.6;

BOOLEAN

Here’s an example of a boolean:

const hasKis = true;

This makes the variable true. if we were to type false, it will make it false.

Null

Null, which is the same as “None” in python, happens when a variable doesn’t exist yet.

Here’s an example:

const homeRoom = null;

Undefined

undefined happens when a variable exist, but isn’t defined in the program.

Here’s an example:

const kd = undefined;

Symbol

symbols variables that always have to be unique. They cannot be the same.

Here’s an example:

const id = Symbol('id');
const id2 = Symbol('id');

And those are all the data types.

Author: Zende_

From PA. EHS 2025. Does computer programming and such. That's really it.

2 thoughts on “Data Types In JavaScript”

Leave a Reply

Your email address will not be published. Required fields are marked *