Blog

python tutorials and learn python

Created with Sketch.

JavaScript confirm

JavaScript confirm Summary: in this tutorial, you will learn how to display a confirmation dialog by using the JavaScript confirm() method. Introduction to JavaScript confirm() method To invoke a dialog with a question and two buttons OK and Cancel, you use the confirm() method of the window object: let result = window.confirm(question); Code language: JavaScript…
Read more

JavaScript alert

JavaScript alert Summary: in this tutorial, you will learn how to display an alert dialog by using the JavaScript alert() method. Introduction to JavaScript alert() method The browser can invoke a system dialog to display information to the user. The system dialog is not related to the webpage being shown in the browser. It also…
Read more

JavaScript Window

JavaScript Window Summary: in this tutorial, you will learn about the JavaScript window object which is the global object of JavaScript in the browser and exposes the browser’s functionality. The window object is global The global object of JavaScript in the web browser is the window object. It means that all variables and functions declared…
Read more

JavaScript BOM

JavaScript BOM The Browser Object Model (BOM) is the core of JavaScript on the web. The BOM provides you with objects that expose the web browser’s functionality. Section 1. Window Window – understand the window object. Alert – display an alert dialog. Confirm – display a modal dialog with a question. Prompt – prompt the…
Read more

Regular Expression: Sets and Ranges

Regular Expression: Sets and Ranges Summary: in this tutorial, you will learn about the sets and ranges in regular expressions. Sets The square brackets search for any character in a set. For example, [aeiou] matches any of the five characters: ‘a’, ‘e’, ‘i’, ‘o’ and ‘u’. The […] is called a set. For example, the…
Read more

JavaScript Regex Replace

JavaScript Regex Replace Summary: in this tutorial, you’ll learn how to use the string replace() method to return a new string with some or all matches of a regular expression replaced by a replacement string. Introduction to the JavaScript replace() method The String.prototype.replace() method works with both strings and regular expressions. This tutorial focuses solely…
Read more

JavaScript Regex match()

JavaScript Regex match() Summary: in this tutorial, you’ll learn about the JavaScript String match() method to match a string against a regular expression. To understand how the match() method works and how to use it effectively, you should have the basic knowledge of regular expression. Introduction to the JavaScript match() method The String match() method…
Read more

JavaScript Regex Lookbehind

JavaScript Regex Lookbehind Summary: in this tutorial, you’ll learn how to use JavaScript regex lookbehind in regular expressions to match X if it is preceded by Y. Introduction to the JavaScript regex lookbehind In regular expressions, a lookbehind matches an element if there is another specific element before it. A lookbehind has the following syntax:…
Read more

Lookahead

Lookahead Summary: in this tutorial, you’ll learn about JavaScript regex lookahead to match X but if only it is followed by Y. Introduction to JavaScript regex lookahead In regular expressions, a lookahead allows you to match X but only if it is followed by Y. Here’s the syntax of the lookahead: X(?=Y) Code language: JavaScript…
Read more

Regex Alternation

Regex Alternation Summary: in this tutorial, you’ll learn about JavaScript regex alternation, which is the “OR” operator in regular expressions. Introduction to the regex alternation Regex uses the pipe operator (|) to represent an alternation, which is like the logical OR operator in regular expressions. The alternation allows you to match either A or B:…
Read more