0% found this document useful (0 votes)
2 views

JavaScript_Full_Course

This document provides a comprehensive overview of JavaScript, covering its definition, inclusion methods, variables, data types, operators, conditionals, loops, functions, arrays, objects, DOM manipulation, events, form validation, local storage, JSON, Fetch API, ES6 features, and practice projects. It includes code examples for each topic to illustrate usage. The document serves as a foundational guide for learning JavaScript programming.

Uploaded by

kanand1411
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

JavaScript_Full_Course

This document provides a comprehensive overview of JavaScript, covering its definition, inclusion methods, variables, data types, operators, conditionals, loops, functions, arrays, objects, DOM manipulation, events, form validation, local storage, JSON, Fetch API, ES6 features, and practice projects. It includes code examples for each topic to illustrate usage. The document serves as a foundational guide for learning JavaScript programming.

Uploaded by

kanand1411
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

JavaScript Full Course

1. What is JavaScript?

JavaScript is a scripting language used to create dynamic and interactive content on websites. It runs in the

browser.

2. How to Include JavaScript

<script>console.log('Hello World');</script>

Or use external file:

<script src='script.js'></script>

3. Variables (let, const, var)

let name = 'John';

const age = 25;

var isOld = false;

4. Data Types

String, Number, Boolean, Undefined, Null, Object, Array

5. Operators

+, -, *, /, %, ==, ===, !=, !==, >, <, >=, <=, &&, ||, !

6. Conditionals

if (age > 18) {

console.log('Adult');

} else {

console.log('Minor');
}

7. Loops

for (let i = 0; i < 5; i++) {

console.log(i);

while (x < 10) {

x++;

8. Functions

function greet(name) {

return 'Hello ' + name;

const greet = (name) => `Hello ${name}`;

9. Arrays

let fruits = ['apple', 'banana', 'cherry'];

fruits.push('orange');

10. Objects

let person = {name: 'Alice', age: 22};

console.log(person.name);

11. DOM Manipulation

document.getElementById('demo').innerText = 'Hello';
document.querySelector('.class').style.color = 'blue';

12. Events

button.addEventListener('click', function() {

alert('Clicked!');

});

13. Form Validation

function validate() {

let x = document.forms['myForm']['email'].value;

if (x == '') alert('Email required');

14. Local Storage

localStorage.setItem('name', 'John');

let name = localStorage.getItem('name');

15. JSON

let obj = {name: 'Max'};

let str = JSON.stringify(obj);

let back = JSON.parse(str);

16. Fetch API (Basic)

fetch('https://api.example.com')

.then(res => res.json())

.then(data => console.log(data));


17. ES6 Features

Arrow functions, Template literals, Destructuring, Spread/Rest operators, Promises, Let/Const

18. Practice Projects

1. Calculator

2. To-Do App

3. Form Validation

4. Quiz App

5. Weather App using API

You might also like