Blog

python tutorials and learn python

Created with Sketch.

JavaScript Execution Context

JavaScript Execution Context Summary: in this tutorial, you will learn about the JavaScript execution context to deeply understand how JavaScript code gets executed. Introduction to the JavaScript execution context Let’s start with the following example: let x = 10; function timesTen(a){ return a * 10; } let y = timesTen(x); console.log(y); // 100 Code language:…
Read more

JavaScript Reflection

JavaScript Reflection Summary: in this tutorial, you will learn about the JavaScript reflection and Reflect API in ES6. What is reflection In computer programming, reflection is the ability of a program to manipulate variables, properties, and methods of objects at runtime. Prior to ES6, JavaScript already has reflection features even though they were not officially…
Read more

JavaScript Proxy

JavaScript Proxy Summary: in this tutorial, you will learn about the JavaScript Proxy object in ES6. What is a JavaScript Proxy object? A JavaScript Proxy is an object that wraps another object (target) and intercepts the fundamental operations of the target object. The fundamental operations can be the property lookup, assignment, enumeration, and function invocations,…
Read more

JavaScript const: Declaring Constants in ES6

JavaScript const: Declaring Constants in ES6 Summary: in this tutorial, you’ll learn how to define constants by using the JavaScript const keyword. Introduction to the JavaScript const keyword ES6 provides a new way of declaring a constant by using the const keyword. The const keyword creates a read-only reference to a value. const CONSTANT_NAME =…
Read more

Differences Between var and let

Differences Between var and let Summary: in this tutorial, you will learn about the differences between the var and let keywords. #1: Variable scopes The var variables belong to the global scope when you define them outside a function. For example: var counter; Code language: JavaScript (javascript) In this example, the counter is a global…
Read more

JavaScript let: Declaring Block-Scoped Variables

JavaScript let: Declaring Block-Scoped Variables Summary: in this tutorial, you will learn how to use the JavaScript let keyword to declare block-scoped variables. Introduction to the JavaScript let keyword In ES5, when you declare a variable using the var keyword, the scope of the variable is either global or local. If you declare a variable…
Read more

Optional catch Binding

Optional catch Binding Summary: in this tutorial, you will learn how to use the optional catch binding in the try…catch statement. Introduction to the optional catch binding The try…catch statement is used to handle any errors that may occur. Generally, you place the code that may cause an error in the try block and the…
Read more

JavaScript Throw Exception

JavaScript Throw Exception Summary: in this tutorial, you’ll learn how to use the JavaScript throw statement to throw an exception. Introduction to the JavaScript throw statement The throw statement allows you to throw an exception. Here’s the syntax of the throw statement: throw expression; Code language: JavaScript (javascript) In this syntax, the expression specifies the…
Read more

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