prompt JavaScript
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 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:…
The JavaScript split method iallows you to split a string based on a separator, save the sub-strings obtained in an array and then return the array thus formed. The syntax…
JavaScript trim method is used to remove whitespace from the beginning and end of a string. Then the trim() method cleans the string of any blanks entered incorrectly. These characters…
JavaScript substring method applies to strings to extrapolate a portion of them. substring follows the syntax: string.substring(start, end); Where start indicates from which character it must begin, while end indicates…
The toLowerCase in JavaScript is a method useful for converting a string to lowercase and has the following syntax: string.toLowerCase(); Where string represents the string to convert to lowercase. Also…