Class PPT
Agenda
Array
- An array in JavaScript is a special variable that can hold multiple values.
- Arrays allow you to store, access, and manipulate lists of data efficiently.
- array declaration can be done in two ways:
- Using Square Brackets (Recommended)
- Using the Array Constructor
let fruits = ["Apple", "Banana", "Mango"];
let fruits = new Array("Apple", "Banana", "Mango");
- Square brackets [] are preferred because they are more concise.
- Array elements are accessed using index numbers, starting from 0.
Window Object
- It represents an open window in the browser. It is browser's object(not JS object) which is created automatically.
- It is a global object with lot of properties and methods.
DOM (Document Object Model)
- When a webpage is loaded the browser creates DOM of the page.
- It is the data representation of the objects that comprise the structure and content of a document on the web.
- DOM represents an HTML document in memory.
- The DOM represents the document as nodes and objects so that programming languages can interact with the page.
- In both cases, it is the same document but the Document Object Model (DOM) representation allows it to be manipulated.