Explore all chapters and subchapters in a clear, organized format designed for better learning and faster navigation.
Write Javascript code inside console
JavaScript Fundamental
How to add JavaScript to html
Live Server
Is JavaScript case sensitive?
Array in JavaScript
How to create Array in JavaScript
JavaScript Primitive Data Types
Object Data Types in JavaScript
Function Declaration
Anonymous function
Named Function Expressions
Passing Functions as Arguments to Other Functions
Create Functions Conditionally
Define Functions Within the Scope of Another Function
Arrow functions
IIFE (Immediately Invoked Function Expression)
Synchronous And Asynchronous
Callback functions with Synchronous operation
Callback functions with an asynchronous operation
Callback Hell
JavaScript Object
Creating an object using a constructor function
function Animal(type, legs, sound) { this.animalType = type; this.numberOfLegs = legs; this.sound = sound; this.isPet = false; } // Creating instances of the Animal constructor var dog = new Animal('Dog', 4, 'Bark'); var cat = new Animal('Cat', 4, 'Meow'); var parrot = new Animal('Parrot', 2, 'Squawk'); Animal.prototype.nameOfAnimal = "My pet"; Animal.prototype.makeSound = function() { console.log(this.sound); }; dog.makeSound(); cat.makeSound(); parrot.makeSound(); // console.log(dog.nameOfAnimal); // console.log(cat.nameOfAnimal); // console.log(parrot.nameOfAnimal); // console.log(dog.isPet); // console.log(cat.isPet); // console.log(parrot.numberOfLegs);
Adding Properties and Methods to Objects using Prototypes in JavaScript
Prototypes in JavaScript, In Browser