Found 10483 Articles for Web Development

How to use setTimeout() function in JavaScript?

Mayank Agarwal
Updated on 28-Apr-2022 14:22:15

4K+ Views

The setTimeout() function is provided by the window object, which calls the specified JavaScript function after the specified time only. This function will be called just once after waiting for the timeout set by the user.It is similar to an alarm or reminder functionality. In the same way, we set up the timeout for the desired time period after which this function is called. This method is used where we are required to add a delay in the execution of a function. This method can also be used for animations or DOM manipulations in JQuert.The input set up in the ... Read More

What is a typical use case for JavaScript anonymous functions?

Mayank Agarwal
Updated on 28-Apr-2022 13:48:59

466 Views

In this article, we are going to explore the Anonymous functions in JavaScript and also learn about their use cases. An anonymous function is a special type of function that does not have any name associated with it.In JavaScript, we normally use the function () keyword before defining any function in JavaScript. However, in anonymous functions in JavaScript, we only use the keyword function for defining the function without any supported name.An anonymous function cannot be accessed after it is created, it can only be accessed by a variable that is stored in the function as the value. An anonymous ... Read More

What are the Pros and Cons of JavaScript Frameworks?

Mayank Agarwal
Updated on 28-Apr-2022 13:43:36

441 Views

JavaScript has become the most widely used language in the field of web development in a relatively short span of time. For the last 25 years, the JavaScript frameworks have been driving web developmentIn this article, we are going to elaborate upon the uses of JavaScript frameworks along with their pros and cons. These JavaScript frameworks empower the language to achieve its best with minimal to no configuration. JavaScript can be used as both the frontend and backend technologies.JavaScript FrameworksThese are the frameworks that provide the basic platform for constructing the JavaScript app for developers. This saves the developers most ... Read More

What are the Important Array Methods in JavaScript?

Mayank Agarwal
Updated on 28-Apr-2022 13:35:58

195 Views

In this article, we are going to explore different methods provided by Array and their importance in JavaScript. We will learn how to use them and what are their actual use cases with the help of examples.Before moving on to methods, below is the syntax for creating an array in JavaScript −let array = [element1, element2, ...Alternatively, we can also define the array as follows −let array = new Array (element1, elemnet2, ...Now, we will be learning about the different methods in the array:push() method − This method is used for pushing an element into the array. The element will ... Read More

What are JavaScript Factory Functions?

Mayank Agarwal
Updated on 28-Apr-2022 13:14:57

13K+ Views

A factory function can be defined as a function that creates an object and returns it. It is similar to constructor functions/class functions.The factory function is a very useful tool in JavaScript since it returns the object of any class directly. We can also populate some fixed static values in these factory functions.These functions do not require the use of the ‘this’ keyword for inner values. Also, they do not need the ‘newnew’ keyword when initiating new objects.Factory functions can contain inner values, methods, and many more. They are just like normal functions but with a specific target i.e. to ... Read More

What are JavaScript Classes and Proxies?

Mayank Agarwal
Updated on 28-Apr-2022 13:09:10

192 Views

In this article, we are going to explore Classes and Proxies and the difference between the two.Classes in JavaScript are similar to functions. The only difference is it uses the class keyword instead of the function. Another important difference between the functions and the classes is that the functions can be called in the code even before they are defined. Whereas the class object should be defined before the class object to prevent it from throwing any Reference error.Syntaxclass Classname {    constructor(property1, property2) {       this.property1 = property1;       this.prop erty2 = property2;    } ... Read More

How to Delete a Linked List in JavaScript?

Mayank Agarwal
Updated on 28-Apr-2022 12:18:55

269 Views

In this article, we are going to explore Linked List and how to delete a linked list in JavaScript.A Linked List is a data structure that is used for storing raw data. The Linked List elements are not stored in contiguous memory locations. The elements in a Linked List are linked using pointers.ExampleIn the below example, we are going to delete the linked list in JavaScript.# index.html    Computed Property           Welcome To Tutorials Point               // Javascript program to delete       // a linked ... Read More

JavaScript: How to Find the Middle Element of a Linked List?

Shriansh Kumar
Updated on 30-Sep-2024 16:02:06

2K+ Views

For a given linked list, write a program in JavaScript to find its middle element. Here, linked lists are a type of linear data structure. If there are an even number of elements in the linked list, there will be two middle nodes. In this case, the middle element would be the latter element out of both elements. Example Scenario: Input: linked_list = 1->2->3->4->5->6-> null Output: middle_element = 4 Using Iteration Iterate over the whole list and count the number of nodes. Now, iterate over the node till count/2 and return the count/2 i.e. the middle element. Example ... Read More

How to use the "in" operator in JavaScript?

Mayank Agarwal
Updated on 28-Apr-2022 11:59:56

183 Views

In this article, we are going to explore the 'in' operator and how to use it in JavaScript. The in operator is an inbuilt operator in JavaScript that is used for checking whether a particular property exists in an object or not. It will return true if the property exists, else false is returned.Syntaxprop in objectParametersThis function accepts the following parameters as described below −prop − This parameter holds the string or symbol that represents a property name or the array index.object − This object will be checked if it contains the prop or not.Return value − This method will ... Read More

How to use Static Variables in JavaScript?

Mayank Agarwal
Updated on 28-Apr-2022 11:55:16

3K+ Views

The keyword "Static" is used for defining a static method or a static property of a class. The benefit of a static method is that we do not need to create an instance or object of the class. It does not have multiple values. It will have a single static value defined during initialization.The keyword static is similar to the const keyword. It is set at the run time when the initialization takes place and these types of variables have global presence and scope. We can use these static variables anywhere over the script.Note − We can reassign and change ... Read More

Advertisements