Skip to main content

Posts

Showing posts from August, 2019

Javscript operators

Welcome file JavaScript Operators The instanceof Operator The instanceof operator is used to check the type of an object at run time. The instanceof operator returns a boolean value that indicates if an object is an instance of a particular class. we can see below example. var fruits = ["apple", "mango", "pineapple"]; fruits instanceof Array; // returns true fruits instanceof Object; // returns true fruits instanceof String; // returns false fruits instanceof Number; // returns false in operator The in operator is used to check whether a given property is available on an object. property in object var fruits = ["apple", "mango", "pineapple"]; apple in fruit //returns true 0 in fruit // returns true 5 in fruit //returns false length in fruit // return true The delete Operator The delete operator deletes a property from an ob

DOM(Document Object Model) and BOM(Browser Object Model)

DOM(Document Object Model) The DOM is the Document Object Model, which deals with the document, the HTML elements themselves, It organize the elements of the document in tree structure (DOM tree) and in the DOM tree, all elements of the document are defined as objects (tree nodes) which have properties and methods.When a web page is loaded, the browser creates a DOM tree for all the objects (Html elements) of that page. e.g. document and all traversal you would do in it, events, etc. A Simple DOM Tree BOM(Browser Object Model) The BOM is the Browser Object Model, which deals with browser components aside from the document,like history, location, navigator and screen (as well as some others that vary by browser). The Browser Object Model (BOM) in JavaScript includes the properties and methods for JavaScript to interact with the web browser. BOM provides you with window object, for example, to show the width and height of the window. It also includes the window.scre