Shubham Vora has Published 957 Articles

How to use JavaScript Fetch API to Get Data?

Shubham Vora

Shubham Vora

Updated on 16-Feb-2023 16:57:43

19K+ Views

Nowadays, JavaScript is useful for writing frontend and backend code. Also, it is the most widely used programming language. Furthermore, we need to get the data from other servers while developing real-time applications. We can fetch data from other servers or databases using the API, which stands for the ... Read More

How to unpack array elements into separate variables using JavaScript?

Shubham Vora

Shubham Vora

Updated on 16-Feb-2023 16:56:35

954 Views

Unpacking array elements means assigning array element values to the new variables. We can assign every element to the separate variables, or we can assign some elements to the separate variables, and for the remaining elements, we can create a new array. In this tutorial, we will learn to unpack ... Read More

How to trim a file extension from a string using JavaScript?

Shubham Vora

Shubham Vora

Updated on 16-Feb-2023 16:55:03

8K+ Views

Many web applications allow users to upload a file. Also, it shows the file content with the filename after trimming the file extension. Furthermore, sometimes we require to store the file's content in the database with the filename without extension as a key. So, various use cases require us ... Read More

How to Toggle an Element Class in JavaScript?

Shubham Vora

Shubham Vora

Updated on 16-Feb-2023 16:53:10

6K+ Views

Toggling an element class means adding and removing a particular class from the HTML element based on a certain condition. For example, we want to highlight the HTML div element, and when the mouse enters, we need to add a particular class with a different style in the HTML ... Read More

How to swap the key and value of JSON element using JavaScript?

Shubham Vora

Shubham Vora

Updated on 16-Feb-2023 16:51:52

3K+ Views

Here, we will learn to swap the key and value of the JSON element using JavaScript. In JavaScript, an object stores the key-value pairs. So, we can swap the key and value as we swap two normal variables. In this tutorial, we will learn different approaches to swapping all ... Read More

How to store all dates in an array present in between given two dates in JavaScript?

Shubham Vora

Shubham Vora

Updated on 16-Feb-2023 16:50:40

3K+ Views

Sometimes, we require to get all the dates between the given date range. In this tutorial, we will take two dates and find all dates between two dates. Also, we will store all dates in the array. Here, we will learn three approaches to storing all dates in an ... Read More

How to store a key => value array in JavaScript?

Shubham Vora

Shubham Vora

Updated on 16-Feb-2023 16:49:31

6K+ Views

Sometimes, we require to map keys to particular values using some data structure in JavaScript. For example, storing the user details in the key value pairs in JavaScript is useful. We can use different data structures, such as objects or maps in JavaScript, to store data in the key-value ... Read More

How to stop browser's back button using JavaScript?

Shubham Vora

Shubham Vora

Updated on 16-Feb-2023 16:47:59

15K+ Views

Stopping the browser’s back button meaning is that preventing users from going to the previous page. Sometimes, we need to prevent users from going to the back of the current page for security purposes. For example, most bank sites don’t allow you to go back when you are doing some ... Read More

How to communicate JSON data between C++ and Node.js ?

Shubham Vora

Shubham Vora

Updated on 16-Feb-2023 15:51:20

2K+ Views

C++ is a powerful, high-performance language widely used for system-level programming and applications. At the same time, Node.js is an open-source, cross-platform JavaScript runtime environment commonly used for web applications. By understanding the various methods for communicating JSON data between C++ and Node.js, developers can choose the best approach to ... Read More

How to check which tab is active using Material UI?

Shubham Vora

Shubham Vora

Updated on 16-Feb-2023 15:50:06

3K+ Views

Material-UI provides a variety of components that help us to build user interfaces with a consistent look and feel. One of the components that Material-UI provides is the Tabs component, which allows us to create tabbed interfaces in our applications. In this tutorial, we will learn how to check which ... Read More

Advertisements