Category: JavaScript Tutorial

python tutorials and learn python

Created with Sketch.

JavaScript Computed Property

JavaScript Computed Property Summary: in this tutorial, you’ll learn about the JavaScript computed properties introduced in ES6. Introduction to JavaScript Computed Property ES6 allows you to use an expression in brackets []. It’ll then use the result of the expression as the property name of an object. For example: let propName = ‘c’; const rank…
Read more

JavaScript Class Expressions

JavaScript Class Expressions Summary: in this tutorial, you’ll learn how to use JavaScript class expressions to declare new classes. Introduction to JavaScript class expressions Similar to functions, classes have expression forms. A class expression provides you with an alternative way to define a new class. A class expression doesn’t require an identifier after the class…
Read more

JavaScript Getters and Setters

JavaScript Getters and Setters Summary: in this tutorial, you will learn about JavaScript getters and setters and how to use them effectively. Introduction to the JavaScript getters and setters The following example defines a class called Person: class Person { constructor(name) { this.name = name; } } let person = new Person(“John”); console.log(person.name); // John…
Read more

JavaScript Class

JavaScript Class Summary: in this tutorial, you’ll learn about the JavaScript class and how to use it effectively. A JavaScript class is a blueprint for creating objects. A class encapsulates data and functions that manipulate data. Unlike other programming languages such as Java and C#, JavaScript classes are syntactic sugar over the prototypal inheritance. In…
Read more

Object Literal Syntax Extensions in ES6

Object Literal Syntax Extensions in ES6 Summary: in this tutorial, you will learn about the syntax extensions of the object literal in ES6 that make your code cleaner and more flexible. The object literal is one of the most popular patterns for creating objects in JavaScript because of its simplicity. ES6 makes the object literal more…
Read more

JavaScript Optional Chaining Operator

JavaScript Optional Chaining Operator Summary: in this tutorial, you’ll learn about the optional chaining operator (?.) that simplifies the way to access values through connected objects. Introduction to the JavaScript optional chaining operator The optional chaining operator (?.) allows you to access the value of a property located deep within a chain of objects without…
Read more

JavaScript Object Destructuring

JavaScript Object Destructuring Summary: in this tutorial, you’ll learn about JavaScript object destructuring which assigns properties of an object to individual variables. If you want to learn how to destructure an array, you can check out the array destructuring tutorial. Introduction to the JavaScript object destructuring assignment Suppose you have a person object with two…
Read more

JavaScript Factory Functions

JavaScript Factory Functions Summary: in this tutorial, you will learn about the JavaScript factory functions which are functions that return objects. Introduction to the factory functions in JavaScript A factory function is a function that returns a new object. The following creates a person object named person1: let person1 = { firstName: ‘John’, lastName: ‘Doe’,…
Read more

JavaScript Object.is()

JavaScript Object.is() Summary: in this tutorial, you will learn about the JavaScript Object.is() to check if two values are the same. The Object.is() behaves like the === operator with two differences: -0 and +0 NaN Negative zero The === operator treats -0 and +0 are the same value: let amount = +0, volume = -0;…
Read more

JavaScript Object.assign()

JavaScript Object.assign() Summary: in this tutorial, you will learn how to use the JavaScript Object.assign() method in ES6. The following shows the syntax of the Object.assign() method: Object.assign(target, …sources) Code language: CSS (css) The Object.assign() copies all enumerable and own properties from the source objects to the target object. It returns the target object. The…
Read more