# JavaScript

## What is <mark>JavaScript</mark>?

**<mark>JavaScript</mark> is a programming language.**

One language that seems to be everywhere. JavaScript has gained a lot of popularity over the years, and, despite facing various stumbling blocks, this language has gone on to become the most popular language in the world today.

<mark>JavaScript</mark> has come a long way, from a language with a prototype written in just 10 days to the most used programming language in the world.

<mark>JavaScript</mark> has nothing to do with Java which only uses a similar syntax style `{}` using its curly brackets which saves us from indentation like Python 🐍

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1673624692627/d1d782bb-5290-4a59-a187-c7df3f8b4082.gif align="center")

Now let's see what we can do with JavaScript

**Adding interactive behaviour to web pages**

**Creating web and mobile apps**

**Building web servers and developing server applications**

**Game development**

To do all this we need to learn some basic data types we can use in JavaScript. Now I want to know who read my blog and want to store the person's name. So I need to store, some data type required.

`personName = "Reader,s name";`

but the JavaScript engine will not understand what you are trying to convey like my blog LOL. We need to declare

`personName` using `var, let, const` .

But What is a variable?

Variable is some sort of a box or a container where you can put in some item but it's a placeholder inside your computer memory.

`let personName = "Rajender";`

var represents variable and const represents constant

<mark>var </mark> declared datatype will allow changing its value in future but a <mark>const</mark> will not allow such thing...

### Data Types

Data types are of two types

1. **Primitive**
    

| ***Data Type*** | ***Description*** | ***Example*** |
| --- | --- | --- |
| **String** | To represent Textual data | "JavaScript", "Your Name" |
| **Number** | Number, floating point (decimal) etc | 69, 7.0, etc |
| **Big Int** | integer with arbitrary precision | 900719925124740999n |
| **Boolean** | To store true or false | true, false |
| **Undefined** | When a variable is declared but not assigned any value | let name; |
| **Null** | denotes a `null` value | let a = null; |

1. **Non - Primitive**
    
    | Data Type | Description | Example |
    | --- | --- | --- |
    | **Object** | Key value pairs collection of data | let person = { }; |
    | **Arrays** | An array is an object that can store multiple values at once. The array is also a Data Structure | let friends = \["Sheldon", "Leonard", "Raj", "Howard"\]; |
    

This is my first blog about JavaScript.

Please share your feedback

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1673676316915/6c9f96ed-b0fc-4ef6-9f18-aadb304b35df.gif align="center")
