AmitDiwan has Published 11365 Articles

Various ways to define a variable in JavaScript

AmitDiwan

AmitDiwan

Updated on 16-Aug-2023 15:42:52

634 Views

In this article, we will learn about the various ways to define and declare variables in javascript, and how we can use them to implement state management in our applications. In javascript, variables can be thought of as containers that hold values, and which can be retrieved later on in ... Read More

How to read a cookie using JavaScript?

AmitDiwan

AmitDiwan

Updated on 16-Aug-2023 15:40:37

3K+ Views

In this article, we will learn how to read cookies in javascript, and how we can use it to implement certain features such as user tracking, user preference, personalized experience, etc. Cookies are small pieces of data stored in a user's web browser. In javascript, we can read cookies using ... Read More

Function returning another function in JavaScript

AmitDiwan

AmitDiwan

Updated on 16-Aug-2023 15:37:40

429 Views

In JavaScript, functions can be assigned to any variables, they can be passed as arguments to other functions, and can even be returned from other functions. This behavior of functions allow us create HOCs in javascript, which are functions that return other functions. These higher−order functions can be used in ... Read More

How to convert Array to Set in JavaScript?

AmitDiwan

AmitDiwan

Updated on 16-Aug-2023 15:33:12

165 Views

This tutorial will teach you how to eliminate duplicate values from an array of items in Javascript by converting an array to a set. When storing distinct values from a collection of data in javascript, we can utilise the Set data structure to get rid of duplicate values. When we ... Read More

How to add delay in a loop in JavaScript?

AmitDiwan

AmitDiwan

Updated on 16-Aug-2023 15:20:32

3K+ Views

Loops are used in JavaScript to repeat actions or iterate over a piece of data. With the aid of various techniques, we can add a delay between each iteration of the loop in order to regulate the speed of execution or produce particular temporal effects. This article will teach you ... Read More

Program to check/uncheck checkboxes using JavaScript

AmitDiwan

AmitDiwan

Updated on 16-Aug-2023 15:14:47

308 Views

We will learn how to check or uncheck checkboxes in javascript in this article, and how we can use it to allow users to make multiple selections on the web page Checboxes are one of the most used HTML elements in forms and user interfaces that allow users to pick ... Read More

JavaScript program to retrieve clients IP address

AmitDiwan

AmitDiwan

Updated on 16-Aug-2023 15:10:46

627 Views

Javascript allows us to obtain a client's IP address. We can then further use this information to fetch their geolocation and tailor content according to their preferences. We can retrieve a client’s IP addresses using different methods, like using a 3rd parties API service such as ipify or ipapi. In ... Read More

How to toggle a boolean using JavaScript?

AmitDiwan

AmitDiwan

Updated on 16-Aug-2023 15:08:11

4K+ Views

In this tutorial, we will learn how to toggle a boolean value in javascript. In addition to this, we will also learn how we can use it for various web application features that require toggling a certain piece of state or value. Toggling a boolean in JavaScript entails altering its ... Read More

Creating auto-resize text area using JavaScript

AmitDiwan

AmitDiwan

Updated on 16-Aug-2023 15:05:39

572 Views

In this post, we are going to learn how to set up an auto−size text area in JavaScript. This text area will be able to change its height automatically depending on the content within it. Auto−size text in JavaScript is a helpful feature that can be used to edit multiple ... Read More

Location protocol Property in JavaScript

AmitDiwan

AmitDiwan

Updated on 16-Aug-2023 15:03:36

116 Views

This article will teach us how to use the Javascript location protocol properties to implement the web application's protocol. The read−only location.protocol property in javascript returns the protocol specified in the current webpage's URL. It offers details on the URL's protocol, including "http:", "https:", "file:", etc. Common protocol values that ... Read More

Advertisements