Category: JavaScript Tutorial

python tutorials and learn python

Created with Sketch.

JavaScript try…catch…finally

JavaScript try…catch…finally Summary: in this tutorial, you’ll learn how to use the JavaScript try…catch…finally statement to catch exceptions and execute a block whether the exceptions occur or not Introduction to the JavaScript try…catch…finally statement The try…catch statement allows you to catch exceptions and handle them gracefully. Sometimes, you want to execute a block whether exceptions…
Read more

JavaScript try…catch

JavaScript try…catch Summary: in this tutorial, you will learn how to use the JavaScript try…catch statement to handle exceptions. Introduction to JavaScript try…catch statement The following example attempts to call the add() function that doesn’t exist: let result = add(10, 20); console.log(result); console.log(‘Bye’); Code language: JavaScript (javascript) And the JavaScript engine issues the following error:…
Read more

The Beginner’s Guide to JavaScript Set Type in ES6

The Beginner’s Guide to JavaScript Set Type in ES6 Summary: in this tutorial, you will learn about the JavaScript Set object that allows you to manage a collection of unique values of any type effectively. Introduction to the JavaScript Set object ES6 provides a new type named Set that stores a collection of unique values…
Read more

JavaScript Map Object

JavaScript Map Object Summary: in this tutorial, you will learn about the JavaScript Map object that maps a key to a value. Introduction to JavaScript Map object Before ES6, we often used an object to emulate a map by mapping a key to a value of any type. But using an object as a map…
Read more

The Ultimate Guide to JavaScript Symbol

The Ultimate Guide to JavaScript Symbol Summary: in this tutorial, you will learn about the JavaScript symbol primitive type and how to use the symbol effectively. Creating symbols ES6 added Symbol as a new primitive type. Unlike other primitive types such as number, boolean, null, undefined, and string, the symbol type doesn’t have a literal form.…
Read more

JavaScript Top-level await

JavaScript Top-level await Summary: in this tutorial, you’ll learn about the JavaScript top-level await and its use cases. Introduction to the JavaScript top-level await ES2020 introduced the top-level await feature that allows a module to behave like an async function. A module that imports the top-level await module will wait for it to load before…
Read more

JavaScript import

JavaScript import Summary: in this tutorial, you’ll learn how to dynamically import modules by using the function-like import() in ES2020. Introduction to the JavaScript import() ES6 introduced the module concept that allows you to develop modular JavaScript code. Suppose you have the following simple HTML document that has one button: <!DOCTYPE html> <html> <head> <title>Module…
Read more

A Comprehensive Look at ES6 Modules

A Comprehensive Look at ES6 Modules Summary: in this tutorial, you will learn about ES6 modules and how to export variables, functions, and classes from a module, and reuse them in other modules. An ES6 module is a JavaScript file that executes in strict mode only. It means that any variables or functions declared in the…
Read more

JavaScript Async Generators

JavaScript Async Generators Summary: in this tutorial, you’ll learn about the JavaScript async generators that iterate over data that comes asynchronously. What is an async generator? An async generator is similar to a regular generator except that its next() method returns a Promise. To iterate over an async generator, you use the for await…of statement.…
Read more

JavaScript Asynchronous Iterators

JavaScript Asynchronous Iterators Summary: in this tutorial, you will learn about the JavaScript asynchronous iterators that allow you to access asynchronous data sequentially. Introduction to JavaScript Asynchronous Iterators ES6 introduced the iterator interface that allows you to access data sequentially. The iterator is well-suited for accessing the synchronous data sources like arrays, sets, and maps.…
Read more