Author: Saim Khalid
-
Dialog Boxes
JavaScript supports three important types of dialog boxes. These dialog boxes can be used to raise and alert, or to get confirmation on any input or to have a kind of input from the users. Here we will discuss each dialog box one by one. Alert Dialog Box An alert dialog box is mostly used…
-
Page Redirection
What is Page Redirection? You might have encountered a situation where you clicked a URL to reach a page X but internally you were directed to another page Y. It happens due to page redirection. This concept is different from JavaScript Page Refresh. There could be various reasons why you would like to redirect a user from…
-
Rest Parameter
Rest Parameter The rest parameter in JavaScript allows a function to accept a variable number of arguments as an array. When the number of arguments that need to pass to the function is not fixed, you can use the rest parameters. The JavaScript rest parameters allow you to collect all the remaining arguments in a single array.…
-
Atomics Objects
The Atomics object in JavaScript provides a set of static methods for performing atomic operations on SharedArrayBuffer objects. Atomic operations are operations that are guaranteed to be completed in a single step, without being interrupted by other threads. This makes them useful for implementing concurrent data structures and algorithms. The Atomics object in JavaScript, as…
-
Async Iteration
Asynchronous Iteration In JavaScript, asynchronous iteration refers to the ability to iterate over asynchronous sequences or collections, such as those returned by asynchronous functions or generators. Async iteration is typically used with operations that involve asynchronous tasks, such as fetching data from a remote server or reading from a file. Understanding Asynchronous Operations In basic…
-
Ajax
Asynchronous JavaScript and XML (Ajax) represents a web development technique: it enables dynamic, interactive communication between server and webpage without necessitating complete page reload. The descriptor “asynchronous” underlines that data exchanges can occur in the background, independent of user experience disruption. Rather than idly awaiting full-page refreshment; Ajax empowers real-time updates on specific sections of…
-
Validate URLs
In this chapter, we will learn how we can validate URLs in JavaScript. Before knowing how to validate URLs, let’s understand what a URL is. What is a URL? A URL or Uniform Resource Locator identifies web pages, images, and videos on the internet. URLs are website addresses that transfer files, send emails, and many…
-
Unit Testing
Unit testing is must in software development life-cycle. It is a process in which we can test small units of code individually to ensure that they are working correctly. In JavaScript, we can use various unit testing frameworks to test our code. Unit testing help us to find bugs early in the development process. Instead…
-
Undefined Check
When the value is absolutely not present in the variable or string or anything else, we call it as Undefined. In JavaScript, undefined is a one of the primitive data type. It is used to represent the absence of a value. It get assigned to a variable when it is declared but not assigned any…
-
Short Circuiting
In JavaScript, short-circuiting is a feature that checks conditions and stops as soon as it knows the answer. It doesn’t look for the rest of the expression, and that prevent unnecessary evaluations. Short-Circuiting for && operator Short circuit evaluation with &&(AND) logical operator means if the first expression evaluates to false then whole expression will be false…