Tag Archives: javascript-object

The conttructor property returns a reference to the object constructor function that has created the instance of an object. The value of the constructor is… Read More
The  __defineSetter__() method is used to bind an object’s property to a function which will be called when an attempt is made to set the… Read More
The __defineGetter__() method is used to bind an object’s property to a function which will be called when the specified property is looked up. It… Read More
We can create a JavaScript object with an object literal: Example : var obj = { firstname : "Romy", lastname : "kumari", age : 20}… Read More
window.location and document.location: These objects are used for getting the URL (the current or present page address) and avert browser to a new page or… Read More
The filter() method basically outputs all the element object that pass a specific test or satisfies a specific function. The return type of the filter()… Read More
Both freeze and seal are used to create non extensible objects in JavaScript, but there are plenty of differences between them. Object.seal() allows changes to… Read More
An HTML document contains some methods and the task is to get all methods of the object. There are two methods to solve this problem… Read More
The task is to convert an Object {} to an Array [] of key-value pairs using JavaScript. Introduction: Objects, in JavaScript, is it’s most important… Read More
In ES5 and earlier, you could not use a variable as a property name inside an object literal. The only option you had was to… Read More
Given a JSON object and the task is to swap the JSON object key with values and vice-versa with the help of JavaScript. Approach 1:… Read More
There are two methods to iterate over an object which are discussed below: Method 1: Using for…in loop: The properties of the object can be… Read More
Given a JavaScript object and the task is to get the last element of the JavaScript object. Approach 1: Use Object.keys() method to get the… Read More
Create an associative array containing key-value pair and the task is to remove the objects from an associative array using JavaScript. We can remove objects… Read More
Given two JavaScript array/array objects and the task is to compare the equality of both array objects. Approach 1: Use jQuery not() method to check… Read More