JavaScript Data Types – Programming Simplified

What are data types?

data type is a classification of data which tells the compiler how the programmer intends to use the data.

Think of this as you telling your computer how it should use the information you give it. For example if you want to add to number you have to tell your computer you’re using numbers. Then it would know “oh these are numbers”, I can add or even subtract these.

JavaScript has six data types, five primitives and an object

What is a primitive?

A primitive is a value that cannot be changed.  Think of these are a really long list of accepted values understood by your computer. i.e 1, 2, true, false, “a”, “b”,”cow”, “dog”, the list goes on. Think a really really really big dictionary.

Data Types:

  • Boolean (P)
    • This can only be true or false
    • Think yes or no
      var isOld = false;

       

If you like this article or would like a specific topic explained drop and comment below. I would love to hear your feedback!