callback functions
The callback functions are used in JavaScript to ensure that the code is asynchronous, i.e. executed after a certain event, such as when a button is clicked, or when you…
The callback functions are used in JavaScript to ensure that the code is asynchronous, i.e. executed after a certain event, such as when a button is clicked, or when you…
Callbacks in JavaScript, as seen in the previous lesson, can be passed as arguments to other functions. In fact, functions in JavaScript are objects. We can also see this simply…
In this lesson we will talk about JavaScript callback functions, which are functions that are passed as parameters to other functions. In the JavaScript version ES5 they are widely used,…
format JSON – JSON is a format used for data exchange and is the acronym for JavaScript Object Notation. It is based on the JavaScript language and is used a…
In this article we will talk about prompt in JavaScript, that is, windows that require a user to enter data. The prompt () method therefore allows you to bring up…
In this article we will talk about confirm in JavaScript, that is, how to create a window where the user can make a choice. With the confirm () method, unlike…
In this lesson we will talk about alert in JavaScript, i.e. window.alert(), used to communicate a message to the user. Alert () is therefore a method of the window object,…
JavaScript functions are fundamental blocks of code, consisting of one or more instructions, which perform one or more actions. A function in JavaScript is defined by the keyword function followed…
In this lesson we will talk about JavaScript for loop and we do some usage examples to better understand how it works. The for loop is an iterative structure that…
In JavaScript the do while loop, as well as in other languages where this construct exists, allows you to execute instructions at least once. If the condition is true then…
In this lesson we will talk about the JavaScript while loop and we will also do some very simple examples to understand how it works. The while is a pre-conditional…
The length of a string in JavaScript is calculated with the length property, that count the amount of characters in that string. The syntax is therefore the following: string.length, where…
JavaScript charCodeAt method, to be used on strings, takes an index as an optional parameter. This method returns the Unicode character of the corresponding character specified by the index. So…
The JavaScript charAt method used on strings returns one character from a string. The position of the character is indicated in the index between round brackets. So for example charAt…
JavaScript search method looks for a string and returns the location of its match. The value to search for can be a string or a regular expression. If the occurrence…
The JavaScript replace method is used on strings to replace one or more values. The syntax is therefore the following: string.replace (value, newValue). Then the method accepts two mandatory parameters,…
The JavaScript lastIndexOf method can be used, as well as indexOf, with both arrays and strings. In this lesson we will study it by applying it to strings. The syntax…
The JavaScript indexOf method can be used with both arrays and strings. indexOf in this lesson is applied to strings. The syntax of this JavaScript method is therefore the following:…