> For the complete documentation index, see [llms.txt](https://neha-admec.gitbook.io/write-about-the-javascripts-basic-grammar-types/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://neha-admec.gitbook.io/write-about-the-javascripts-basic-grammar-types/write-about-the-javascripts-basic-grammar-and-types.md).

# Write about the JavaScript's basic grammar and types

A machine independent high level language which is known as JavaScript and being update and maintained by the ecma script, runs on browsers and even on the server. Programming is list of instructions which do runs linearly, we can say that grammar is the foundation of the language, and programming languages are built on the sets of the rules called syntax of the language. It is important to understand these rules while pursing your training with [**JavaScript course in Delhi.**](https://www.admecindia.co.in/course/best-javascript-master-course/)

### Grammar of the JavaScript

We can understand the grammar of the JavaScript as:

1. **Variables declaration**

Variables are the containers which is used to store the data, in JavaScript we can define variables by using such keywords: var, let, const. We can store different types of data into the variables of JavaScript such as:

**String**: a string type of data can include the sequences of characters, spaces, numbers or punctuations.

**Numbers:** can only store numbers.

**2. Expressions**

An expressions is the combination of number, string and values to generate an output. And an expression is being evaluated from right to left direction while execution of the code. Let’s see an example of it:

let a = 10;

let b = a + 15;

In this above example, the right hand side values will be evaluated and then being stored into the left hand side variables.

**3. Arithmetic**

There are basically five types of arithmetic operators in the javascript to evaluate the math expressions, they are such as:

+, -, \*, /, %

Let’s see an example:

var myNumber = 10 + 2;

console.log(myNumber);

**4. Booleans**

Booleans are typed of variables in JavaScript which can be used to store true or false.

Let’s see an example:

var myBooleans = true

console.log(myBooleans)

**5. Comparisons**

Comparisons operators are used to compares the values in JavaScript, there are seven kind of ways to compare to compare the data, all of them are listed here:

* \> Greater than
* < Less than
* \>= Greater than or equal to
* <= Less than or equal to
* != Not equal to
* \== Equal to
* \=== Strict equal to

There is a difference between equal to and strict equal to comparisons,

**equal to:** will only compare the data value of the variables not the type of the values.

**Let’s see an example**:

let a = 10;

let b = “10”;

if ( a == b ) {

console . log ( “ Matched ” ) ;

}

else {

console . log ( “ Does not match ” ) ;

}

In the above code, the output will be “Matched” because they both have the same values.

**Strict equal to:** it will compare the data as well as the data type of the values.

**Let’s see an example:**

let a = 10;

let b = “10”;

if ( a === b ) {

console . log ( “ Matched ” ) ;

}

else {

console . log ( “ Does not match ” ) ;

}

In the above code, the output will be “Does not match” because they both have the same values but does not have the same data type and the strict equal to checks the both while comparing.

Check some useful [**web design courses**](https://www.admecindia.co.in/courses/web-designing-courses/)[ **in Delhi**](https://www.admecindia.co.in/courses/web-designing-courses/) and pick up the one that suits the most for making career in this web industry.

**6. Undefined**

If a variable is being declared but it’s value is not defined then it will hold the value as undefined, and when a variable is given the value the it is called initialization of the variable. And if the variable is only declared then it is known as declaration of the variable. Let’s see the example of them here:

Declaration:

let a; // here the variable is declared but not defined by the value

Initialization:

a = 10;

So these are some of the basic grammar rules and types of the JavaScript that a beginner can learn and understand. There is a 18 months [**Full Stack development course in Delhi**](https://www.admecindia.co.in/course/most-advanced-web-design-development-master-plus-course/) and it is a complete full-stack web development course that gives complete understanding of all the website designing and development languages including JavaScript.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://neha-admec.gitbook.io/write-about-the-javascripts-basic-grammar-types/write-about-the-javascripts-basic-grammar-and-types.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
