Found 6685 Articles for Javascript

Using data in JSON format in Snack

Saba Hilal
Updated on 02-May-2023 14:43:09

545 Views

There are lots of ways to use data with apps made with Snack Expo. Sometimes the data is stored as JSON, that mean JavaScript Object Notation. In this format, the data can be stored easily as Key-Value pairs and can also be converted to a CSV file. In this article, using javascript on Snack, the methods to use JSON data are specified. In example 1, the method to read this data and to display it as a table is given. In the second example, the methods of saving the JSON data as a CSV file and to download it, is ... Read More

What is tree shaking in JavaScript?

Shubham Vora
Updated on 24-Apr-2023 17:07:18

188 Views

What is Tree Shaking? If you are an experienced JavaScript developer, you may hear about tree shaking. It is a common technique to remove unused codes from the application and also, and it removes unused imports from the application. Here, the ‘Tree shaking’ term is introduced by shaking a tree, removing unnecessary branches of the code, and keeping the required code in the final bundle. Basically, tree shaking is used to eliminate the dead or unused code. Why do we Require Tree Shaking? As we have seen in the above part of the tutorial, tree shaking is used to remove ... Read More

What is server-sent events in JavaScript?

Shubham Vora
Updated on 24-Apr-2023 17:06:31

1K+ Views

What is Server-sent Events in JavaScript? In JavaScript, server-sent events (SSE) enable the server to send data to the client. The client require to establish a connection with the server to get data from the server. The server-sent events are similar to the WebSocket as it also establishes a connection between the client and server, and it is useful to send data on both sides. But server-sent events allow unidirectional communication, which means the server can send data to the client, but the client can’t send data to the server. Let’s build a real-time React and Node application to use ... Read More

What are the events available for server sent events in JavaScript?

Shubham Vora
Updated on 24-Apr-2023 17:05:06

204 Views

The server-sent events allow developers to open a connection between the server and the client and send data from the server to the client. Basically, it is a one-way communication, which means we can send data from the server to the client but not from the client to the server. Here, we will discuss all events available for the server-sent events in JavaScript. Events Available for Server-sent Events in JavaScript There is a total of 4 different events available for server-sent events in JavaScript. ‘onopen’ − The ‘open’ event fires when the connection between the client and server is ... Read More

Text to Voice conversion using Web Speech API of Google Chrome

Shubham Vora
Updated on 24-Apr-2023 17:03:52

781 Views

Nowadays, the audiobook is more preferred by readers to reading books as they can grab knowledge while doing any work by listening to it. Also, some website adds the audio of the article in every article, so if users don’t want to read the article, they can listne to it. To convert normal text to voice, we require to use the web speech api of Google Chrome. In this tutorial, we will learn to use the web speech API of Google Chrome to convert text to voice. Syntax Users can follow the syntax below to use the web speech API ... Read More

Javascript Program to Check if two numbers are bit rotations of each other or not

Shubham Vora
Updated on 24-Apr-2023 17:02:49

150 Views

Problem Statement − We have given two integer numbers and need to check whether the two numbers are bit rotations of each other. In JavaScript, every integer is a 32-bit binary number which is a representation of 0 and 1. Here, we need to check if we rotate the 32-bit string of the first number; we can achieve the 32-bit string of the second number or not out of a total of 32 rotations of the first number. Use the ToString() Method to Check if two Numbers are bit Rotations of Each Other The toString() method is used to convert ... Read More

How to install yup in react native in JavaScript?

Shubham Vora
Updated on 24-Apr-2023 16:57:18

4K+ Views

The Yup is an NPM package we can install in the react-native application. It is used to validate the form values stored in a single object. Also, we can add different kinds of validations to the different form fields using the Yup. Users can execute the below command in the project directory to install the Yup in react native. npm i Yup Users can use the below command if they are using the Yarn. yarn i Yup Syntax Users can follow the syntax below to use the Yup for the form validation in the react-native application. const schema ... Read More

How do you receive server-sent event notifications in JavaScript?

Shubham Vora
Updated on 24-Apr-2023 16:55:10

582 Views

The server-sent event is a unidirectional way to communicate between the server and the client. When we only require to send data from server to client, but not from client to server, we can use the server-sent events. We can use the server-sent events by establishing the connection between the client and server. Here, the server sends the data, and the client receives the data and handles the data to show on the web page. The server can be anything, such as Node, PHP, or Ruby applications. So, when the server sends the data, the ‘message’ event fires on the ... Read More

Firebase to get url

Shubham Vora
Updated on 24-Apr-2023 16:48:09

2K+ Views

Firebase is a backend-as-a-service (BAAS) that provides different services. It includes authentication, cloud storage, hoisting, etc., in the services. Basically, it makes it easy for developers to integrate the authentication, database, etc., in the mobile or web application. In this tutorial, we will explore the cloud storage of Firebase. We will learn to upload images in the Firebase cloud storage and get the URL of the image, which we can use anywhere. Users should follow the steps below to set up the Firebase account and integrate it with a single-page web application. Step 1 − First, Go to the ... Read More

Firebase Integration with Web

Shubham Vora
Updated on 24-Apr-2023 16:45:50

392 Views

Firebase was started by Google in 2014, providing backend services to its users. It provides different kinds of high-quality services which we can use to develop mobile and web applications. For example, it provides a real-time database, user authentication, cloud storage, etc. Furthermore, it also provides analytics to analyze the application’s traffic. It is more popular due to its quick setup. In this tutorial, we will learn to integrate Firebase authentication into the one-page web application. Users should follow the steps below to set up the Firebase account and integrate it with a single-page web application. Step 1 − ... Read More

Advertisements