Shubham Vora has Published 957 Articles

How to use a variable for a key in a JavaScript object literal?

Shubham Vora

Shubham Vora

Updated on 06-Apr-2023 15:00:13

12K+ Views

In JavaScript, sometimes, we are required to use the variables as an object key. For example, when fetching data from the API and not sure about all the response data attributes, we must iterate through the response object and store every property of it. However, we can’t use the variables ... Read More

How to use CircularProgress Component in ReactJS?

Shubham Vora

Shubham Vora

Updated on 06-Apr-2023 14:58:34

2K+ Views

The circular progress bar is an attractive UI for any application. We can show the circular loading indicator whenever our application fetches data from the server; users are uploading files or downloading data. Here, we will learn different approaches to creating a circular progress bar using the various libraries. Use ... Read More

How to show pagination in ReactJS?

Shubham Vora

Shubham Vora

Updated on 05-Apr-2023 16:31:34

617 Views

The pagination allows users to show content on different pages. For example, we have thousands of data and want to show that to users on a single webpage. It will look worse if we show thousands of data on a single page, as users must scroll through all data to ... Read More

How to shard test files in protractor?

Shubham Vora

Shubham Vora

Updated on 05-Apr-2023 16:24:02

189 Views

Sharding is a method for distributing data or tasks across several machines to improve performance and scalability. Sharding is a technique used in test automation to distribute test cases among various instances of the testing framework and speed up test execution. Protractor is a testing framework that facilitates sharding test ... Read More

How to update mouse location when scrolling with jQuery?

Shubham Vora

Shubham Vora

Updated on 05-Apr-2023 15:57:59

1K+ Views

In jQuery, we can trigger the ‘mousemove’ event to detect the mouse pointer's location on the web page. Also, we can detect the scroll using the ‘scroll’ event and subtract that value from the y position to get the relative mouse location. Using the ‘overflow-y: scroll’ CSS property, we can ... Read More

How to throw an error when using a property of an object?

Shubham Vora

Shubham Vora

Updated on 05-Apr-2023 15:55:41

626 Views

In JavaScript, an object contains the properties in the key-value format. We can access any property of an object using the property name by taking the object as a reference. Sometimes, we try to access the object property that doesn’t exist in the object. In such cases, we get the ... Read More

How to throw an error in an async generator function in JavaScript ?

Shubham Vora

Shubham Vora

Updated on 05-Apr-2023 15:53:00

2K+ Views

The code often throws an error, and handling errors is more important. JavaScript also allows users to throw a custom error using the ‘throw’ keyword. We can catch the errors in the catch block. We can use the try-catch syntax to catch errors thrown by normal functions. Let’s understand it ... Read More

How to switch the language of the page using JavaScript?

Shubham Vora

Shubham Vora

Updated on 05-Apr-2023 15:50:29

9K+ Views

Whenever you develop a website or application for a worldwide business, you must also focus on which language your audience can understand. For example, English is an international language, but in some parts of the world, people don’t understand English as they speak German, Spanish etc. However, if you have ... Read More

How to Style Google Custom Search Manually using CSS?

Shubham Vora

Shubham Vora

Updated on 05-Apr-2023 15:47:14

897 Views

Have you ever tried to build a custom search engine? If yes, you are aware of how much effort it takes. The first thing is that we need to create a search algorithm that should show the best matching results when any user searches. It can take a lot of ... Read More

How to store JavaScript functions in a queue and execute in that order?

Shubham Vora

Shubham Vora

Updated on 05-Apr-2023 15:45:32

727 Views

Sometimes, developers may require to store the function in the queue and execute it in the order it is stored in the queue. In JavaScript, we can create a queue using the array. We can use the push() method of the array to enqueue the function in the queue and ... Read More

Advertisements