Types Of Datatypes in Javascript

Neelesh JoshiNeelesh Joshi
1 min read

Primitive

Primitive datatypes includes:

  • Number: For storing any numeric values

      const score = 100;
    
  • Boolean: For storing any value in form of true and false

      const isExist = true;
    
  • String: For storing any strings

      const stringName = "Any string value";
    
  • Null:

      const anyNullValue = null;
    
  • Undefined

      const anyUndefinedValue = undefined;
    
  • Symbol

  • BigInt

      const anyBigIntValue = BigInt("1233737373838383838383");
    

Non Primitive/ Reference

  • Arrays: For storing values in contiguous memory locations

      const arrays = [1, "any string value", false]
    
  • Objects: For storing multiple/different values in form of key-value pairs

      const anyObj = {
          key_1 : "string",
          key_2 : 2,
          key_3 : false
      }
    
  • Functions: For executing operations

      const anyFunction = function(){
          console.log("Hello, beautiful Mountains");
      }
    
0
Subscribe to my newsletter

Read articles from Neelesh Joshi directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Neelesh Joshi
Neelesh Joshi

Hi, am a passionate programmer and front-end web developer I am interested in problem solving