Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
Javascript Articles
Page 257 of 534
How to duplicate Javascript object properties in another object?
In JavaScript, objects are the collection of a key value pairs. The properties of the object are the keys and is denoted with a string. The value of the key is the value of the property of the given object. In JavaScript, the objects can be copied to other by many ways in which some of them are − Using spread operator(…) The spread operator in JavaScript is used to copy the values of the original given object to a new object. This operator is represented by three dots(…). Example 1 This example demonstrates how spread operator is used to ...
Read MoreWhat is the use of .stack property in JavaScript?
The Stack property in JavaScript is used to store and keep track of the errors and saves the information such as the type of the error, where the error is raised and the reason of the error. The path of the origin of the error is also stored in the stacks in JavaScript. Stack is the error class property in JavaScript, which is also used to store the functions that are called, the order of the functions called too. The format of the error shown is as first, in the first line the type of the error will be displayed ...
Read MoreGet div height with vanilla JavaScript
The HTML element is represented by the Div Object in the HTML DOM. When styling other HTML elements with CSS or with JavaScript, this tag is used to indicate the container for those elements. The default container for flow content in HTML is the div element. It doesn't affect the content or layout until it is CSS-styled in some way. The height of the div element can be known in many ways. These ways are discussed in this article. Using offsetHeight The offsetHeight is a property which returns the height of the element in pixels. Syntax The syntax of ...
Read MoreDifference between test () and exec () methods in Javascript
The RegExp.prototype.test() and RegExp.prototype.exec() methods are the methods in JavaScript used to handle regular expressions. In addition to these two JavaScript includes a number of built-in methods for manipulating and processing text using regular expressions. What are regular expressions? Regular expressions are patterns that are used to search for character combinations in a string. Regular expressions are treated as objects in JavaScript and are denoted by either "regex" or "RegExp." The exec() method The exec() method makes a search for the specified match of the string in the given string. If the match of the string is present in the ...
Read MoreDifferent techniques for copying objects in JavaScript
In JavaScript, objects are the collection of a key value pairs. The properties of the object are the keys and is denoted with a string. The value of the key is the value of the property of the given object. Types/Techniques of object copying There are 2 types of copying objects in any language namely: deep copy, and shallow copy. Shallow Copy In this technique an object is copied as little as possible. For suppose if you copy a collection using this technique the structure of the collection is copied to the destination, not the elements. Example Following is an ...
Read MoreIs it possible to change values of the array when doing foreach() in javascript?
Array is a data type which can store multiple elements of similar data types. For example, array is declared as integer data type then it stores one or more elements of the integer data type. In arrays the element can be manipulated when they are in a loop by using any of the mathematical operations or so. For example, if the array elements are numbers, then the numbers can be multiplied by a fixed number or can be added or subtracted also. The change in the array elements can be done by using a user defined program and the result ...
Read MoreHow to disable JavaScript in Opera?
This tutorial will teach you how to disable JavaScript in the Opera web browser. The latest version as used in this tutorial is Version− 89.0.4447.71. About JavaScript The dynamic programming language JavaScript, also known as ECMAScript, was created to provide control over the components of a web application. Your browser loads something on a website known as the Document Object Model (DOM), and JavaScript may work with the items in the DOM to, for example, make a web application responsive to the user. JavaScript is responsible for the existence of every animated menu system, any web form validation or submission, ...
Read MoreHow to enable JavaScript in Windows?
A cross-platform web browser made and developed by Microsoft is called Edge. After being available on various platforms, including Android and iOS in 2017, macOS and earlier Windows versions (Windows 7 and later) in 2019, and Linux in 2020, it was originally packaged with Windows 10 and Xbox One in 2015. Internet Explorer (IE) was replaced as the default web browser in Windows 11 by the Chromium-based Edge (for compatibility with Google Chrome). The original purpose of JavaScript was to "bring online pages alive". Scripts are what this language refers to as programs. They can be included directly in the ...
Read MoreHow to enable JavaScript in Opera?
You will learn how to activate JavaScript in the Opera web browser in this tutorial. Version− 89.0.4447.71 is the most recent version of Opera used in this tutorial. About JavaScript Although it is most famous for being the scripting language for Web pages, JavaScript (commonly abbreviated as JS) is a lightweight, interpreted, object-oriented language with first-class functions that are also utilized in other non-browser applications. It is a dynamic, prototype-based multi-paradigm scripting language that supports imperative, functional, and object-oriented programming paradigmsx JavaScript, which operates on the client side of the web, may be used to plan or program how web ...
Read MoreHow can we debug JavaScript using Firefox?
In this tutorial, we will learn to debug the JavaScript code using the Firefox web browser. Generally, we debug the code to fix the unknown bugs and errors. Mostly it happens with beginner programmers, code works successfully until the last night and suddenly crashes in the morning Programmers don’t need to worry now, even if code crashes. Once you learn to debug the code, you can fix any bugs in a few minutes and make it work fine If users want to learn to debug the code, the first step is to produce the code example with the error. So, ...
Read More