JavaScript Data Types Introduce

Emonibn Salim
2 min readMay 6, 2021

Types of Primitive Values

The Primitive most important javaScript data type values are strings and numbers, of other things
Open your browser console and print these values using console.log()

console.log(5);console.log("hello guys")console.log(undifiend)

Types of Values

javaScript has 2 type

1.Primitive Values

  1. Undefined,
  2. Null,
  3. Booleans,
  4. Numbers,
  5. Strings,
  6. Symbols,
  7. BigInts,

2.Objects and Functions

  1. Objects,
  2. Functions,

1. Undefined (undefined)

Undefined data types most only one value is undefined. It is null like this but again not exactly one thing. Undefined basically any variable default value reveals initialization is not required.

var name = "sohel";var ssn;// undefined

2. Null (null)

Null a special kind of keyword null value (is not value) reveals. In other words, null a data type that is just a value- null. the null value we will only use when our variable value is unknown.

var name = "sohel";var ssn = null;

3. Boolean(boolean)

Boolean all language common data type. It has two values — true and false.
These two values are the reserve words of javaScript. conditional boolean data type uses it.

let enable = true;let disabled =false;

4. Number(number)

Number data type 2 types numeric value presents — 32-bit integer and 64-bit floating-point number .

let age = 25; // simple, decimal, integer let price = 45.95; // floating point

5. String(string)

String more popular a data type which is used to present text. A String how many characters that single or double quotation by abound.

let name = 'yeasin';let lastName = 'emon';

1.Object(object)

The object is a non-primitive data type in JavaScript. It is like any other variable, the only difference is that an object holds multiple values in terms of properties and methods. Properties can hold values of primitive data types and methods are functions.

let car = {
name: "BMW",
colour: "black",
year: "2020",
};

2. Function(function)

JavaScript provides functions similar to most of the scripting and programming languages.

In JavaScript, a function allows you to define a block of code, give it a name and then execute it as many times as you want.

function ShowMessage() {
alert("Hello World!");
}

ShowMessage();

--

--