Given below are some of the JavaScript Frequently Asked Questions. What is JavaScript? What are the features of JavaScript? How to use Internal and external JavaScript? Discuss the data types used in JavaScript? What is meant by event handling? Describe the different type of events that we can handle using JavaScript? What is a function? …
Working with Arrays in JavaScript
February 5, 2022 In this article on Working with Arrays in JavaScript, I will explain how to create and use arrays in JavaScript. Certainly, you will find lots of examples of JavaScript arrays here. For the purpose of creating an array, we can initialize it with values. Also, we can use the Array() constructor. The …
Creating User-Defined Functions in javaScript
In this article, I will explain Creating User-Defined Functions in javaScript. Since many times we need to use the same program statements at several places in a program. Therefore, we create functions that perform a specific task. These functions are called user-defined functions. Once, we have a function for performing a specific task, we can …
Popup Boxes in JavaScript
The following example demonstrates how the Popup Boxes in JavaScript work. Basically, JavaScript offers three popup boxes. In order to display a warning message, we use the alert popup box. It displays a warning message along with an OK button. In order to proceed further, the user requires to press the OK button. Similarly, we …
Creating Classes in JavaScript
In this article on Creating Classes in JavaScript, I will explain how to create and use classes in JavaScript. In fact, ES6 introduces classes in JavaScript. Basically, a class encapsulates data and associated methods. The following code shows the syntax of a class in javaScript. Syntax of a JavaScript Class Examples of Creating Classes in …
Understanding HTTP Requests and Responses
This article explains HTTP Requests and Responses. In order to get data from another server HTTP Requests are made. Basically, these requests occur between API endpoints. API End Points Generally, two servers interact with each other using web services. So, one of the servers is making a request for a resource. While the other one …
What is Asynchronous JavaScript?
In general Asynchronous JavaScript lets the code execute immediately without blocking. For the purpose of understanding this concept let us assume that we have two statements in sequential order in a code. While the first statement being executed, the second one will wait for it to finish. It is known as synchronous execution. On the other hand, if the …
JavaScript Code for Event Handling
The following section demonstrates a JavaScript Code for Event Handling. Before discussing the code, let us understand, how the event handling is done in JavaScript. Event Handling in JavaScript As a result of the user’s actions, a variety of events may occur on a web page. While, it is necessary that some action should be done in …
Callback Functions in JavaScript
Basically, Callback Functions in JavaScript provide us a way to pass a function as a parameter to another function. In fact, callback functions are very useful in performing asynchronous operations and registering an event listener. Examples of Callback Functions in JavaScript As an illustration, the following is an example of a simple callback function that …
Arrow Functions in JavaScript
Basically, Arrow Functions in JavaScript provide us a way to simplify coding the user-defined functions. Further, they let us define anonymous functions. Since, arrow functions provide us a way to write shorter syntax, by including arrow functions in script single statement functions can be created fast and prevent unnecessaey coding. However, there are certain differences …