Skip to content

Tag Archives: JavaScript-Methods

In this article, we will see how to find the median of an array using JavaScript. Examples: Input arr1 : [1 4 7 9] Output… Read More
In this article we will learn to read text content of all <span> elements of a <div> element. Approach: We will first select the division… Read More
Given two or more numbers/array of numbers and the task is to find the GCD of the given numbers/array elements in JavaScript. Examples: Input :… Read More
In JavaScript, the  Object.prototype.toString() method is used to return a string that can represent the object. The toString() method is automatically inherited by every object… Read More
The purpose of this article is to get an object which contains the parameter of the current URL. Example: Input: www.geeksforgeeks.org/search?name=john&age=27 Output: { name: "john",… Read More
JavaScript is very powerful and with it, we can build dynamic web content and add many features to a web application.  With HTML, we create… Read More
Given an array of Promises, we have to run that in a series. To do this task, we can use then(), to run the next… Read More
To navigate URL in iframe with JavaScript, we have to set the src attribute or return the value of src attribute in an iframe element.… Read More
Given three variables as Starting, Ending, and Power. Our task is to find the total sum of all the numbers between Starting and Ending inclusion… Read More
Property Accessors allow access with the property name or keys of an object (Reading, Creating, Updating). There are two notations in JavaScript that allows us… Read More
In JavaScript , the Object.prototype.valueOf() method is used to return the primitive value of the specified object. Whenever a primitive value is required, JavaScript automatically… Read More
Having class = “selected” depending on what page / URL is. This concept is very important especially when designing a navbar for a website so… Read More
In this article, we will see how to detect the runtime environment in which our JavaScript code is running. Suppose you are building an application… Read More
Given a multiline string and the task is to replace line breaks with <br> tag. Example: Input: `Geeks for Geeks is a computer science portal where people… Read More