Abdul Rawoof has Published 35 Articles

Why do we need weakMaps in Javascript?

Abdul Rawoof

Abdul Rawoof

Updated on 26-Aug-2022 11:57:42

265 Views

WeakMap is a collection in JavaScript. This type of collection is used to store the data in the form of key-value pairs. In WeakMap, the key must definitely be an object and the values can be of any type. The difference between a Map and a WeakMap is, in weakmap ... Read More

What is the most efficient way to deep clone an object in JavaScript?

Abdul Rawoof

Abdul Rawoof

Updated on 26-Aug-2022 11:57:23

945 Views

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 ... Read More

What is the use of window.location in javascript?

Abdul Rawoof

Abdul Rawoof

Updated on 26-Aug-2022 11:57:03

2K+ Views

Window.location is the location property of a window and it is a reference to a Location object; it represents the current URL of the document being displayed in that window. Since window object is at the top of the scope chain, so properties of the window.location object can be accessed ... Read More

JavaScript variables declare outside or inside loop?

Abdul Rawoof

Abdul Rawoof

Updated on 26-Aug-2022 11:56:41

4K+ Views

It is believed that there can be any performance-based differences when the variables are declared inside or outside the loops, but there will be no difference. As there is flexibility in any programming language to declare the variables as and when required which will be easy for the users to ... Read More

How to do string interpolation in JavaScript?

Abdul Rawoof

Abdul Rawoof

Updated on 26-Aug-2022 11:56:24

16K+ Views

String interpolation in JavaScript is a process in which an expression is inserted or placed in the string. To insert or embed this expression into the string a template literal is used. By using string interpolation in JavaScript, values like variables and mathematical expressions and calculations can also be added. ... Read More

What's the difference between window.location and document.location?

Abdul Rawoof

Abdul Rawoof

Updated on 26-Aug-2022 11:56:00

1K+ Views

The window.location property The location property of a window (i.e. window.location) is a reference to a Location object; it represents the current URL of the document being displayed in that window. Since window object is at the top of the scope chain, so properties of the window.location object can be ... Read More

How to add a class to DOM element in JavaScript?

Abdul Rawoof

Abdul Rawoof

Updated on 26-Aug-2022 11:55:32

801 Views

HTML is a mark-up language used to create the useful elements of a webpage. The DOM which means Document Object Model is used to manipulate the HTML Document. In DOM, all the elements are defined as objects. The styling in the HTML document can be done by using CSS. In ... Read More

Explain typecasting in Javascript?

Abdul Rawoof

Abdul Rawoof

Updated on 26-Aug-2022 11:55:13

15K+ Views

Typecasting in JavaScript means converting one data type to another data type i.e., the conversion of a string data type to Boolean or the conversion of an integer data type to string data type. The typecasting in JavaScript is also known as type conversion or type coercion. Types of conversions ... Read More

How to get the primitive value of string in Javascript?

Abdul Rawoof

Abdul Rawoof

Updated on 26-Aug-2022 11:54:55

1K+ Views

In JavaScript if the data is not an object and has no methods and properties is called as a primitive data type or a primitive value. The different types of primitive data types in JavaScript are string, number, Boolean, undefined, symbol, null and big int. The primitive types boolean, string ... Read More

Is there is a standard function to check for null, undefined, or blank variables in JavaScript?

Abdul Rawoof

Abdul Rawoof

Updated on 26-Aug-2022 11:54:34

466 Views

No there is not a standard function to check for null, undefined or blank values in JavaScript. However, there is the concept of truthy and falsy values in JavaScript. Values that coerce to true in conditional statements are called truth values. Those that resolve to false are called falsy. According ... Read More

Advertisements