Vanilla JavaScript, commonly referred to as Vanilla JS, is a term used to describe the core JavaScript language, unhanced by any additional frameworks or libraries. In other words, it's plain JavaScript. If you're new to web development or want to build a solid foundation, understanding vanilla JavaScript is crucial. Here, we'll explore some practical examples to enhance your knowledge.

Before diving into examples, let's understand why vanilla JavaScript is vital. Unlike libraries and frameworks, vanilla JavaScript has a smaller learning curve, is directly supported by all modern browsers, and ensures your code remains uncluttered and easy to debug.

Variables and Data Types
One of the first concepts you'll encounter in JavaScript is variables and data types. Variables allow you to store data, and understanding data types ensures you're using them correctly.

Here's a simple example using variables of different data types:
```javascript
let name = 'John Doe'; // string

const age = 30; // number
let is Student = false; // boolean
let cars = ['Toyota', 'Honda', 'Ford']; // array

let person = {name: 'Jane Smith', age: 28}; // object
```
Operators
Operators help you perform operations on variables and values. Here are some basic operators and an example:

Arithmetic: +, -, *, /, %
Assignment: =, +=, -=, *=, /=






![JS scrollIntoView offset with fixed header [2022 Tutorial]](https://i.pinimg.com/originals/8b/81/9e/8b819e7c538105a7056d1d4b6c023d73.jpg)













Comparison: ==, !=, ===, !==, >, <, >=, <=
Logic: &&, ||, !
Example:
```javascript
let x = 10, y = 5;
x = x + y; // 15
x -= y; // 10
(x > y) && (y < x); // true
```
Control Flow
Control flow statements help your program execute logic based on certain conditions. Here's an example using if, else if, and else:
```javascript
let age = 30;
if (age < 18) {
console.log('You are a minor');
} else if (age < 60) {
console.log('You are an adult');
} else {
console.log('You are a senior');
}
```
Functions
Functions in JavaScript allow you to group reusable code. Here's an example with function expressions, declarations, and arrow functions:
Function Expression:
```javascript
let greet = function(name) {
console.log(`Hello, ${name}!`)
};
greet('Alice'); // Hello, Alice!
```
Looping with while and for
Loops allow you to execute code repeatedly. Here are examples using while and for loops:
While Loop:
```javascript
let i = 0;
while (i < 5) {
console.log(i);
i++;
}
// Outputs: 0, 1, 2, 3, 4
```
For Loop:
```javascript
for (let i = 0; i < 5; i++) {
console.log(i);
}
// Outputs: 0, 1, 2, 3, 4
``` Lastly, remember that learning vanilla JavaScript is an ongoing journey. Keep practicing, building projects, and exploring new concepts to solidify your understanding. Happy coding!