Category: JavaScript Tutorial

python tutorials and learn python

Created with Sketch.

JavaScript Prototype

JavaScript Prototype Summary: in this tutorial, you’ll learn about the JavaScript prototype and how it works under the hood. Introduction to JavaScript prototype In JavaScript, objects can inherit features from one another via prototypes. Every object has its own property called prototype. Because a prototype itself is also another object, the prototype has its own…
Read more

JavaScript Constructor Function

JavaScript Constructor Function Summary: in this tutorial, you’ll learn about the JavaScript constructor function and how to use the new keyword to create an object. Introduction to JavaScript constructor functions In the JavaScript objects tutorial, you learned how to use the object literal syntax to create a new object. For example, the following creates a…
Read more

Javascript Object Methods

Javascript Object Methods Summary: in this tutorial, you’ll learn about the JavaScript object methods and how to define methods for an object. Introduction to the JavaScript object methods An object is a collection of key/value pairs or properties. When the value is a function, the property becomes a method. Typically, you use methods to describe…
Read more

JavaScript Default Parameters

JavaScript Default Parameters Summary: in this tutorial, you will learn how to handle JavaScript default parameters in ES6.function say(message=’Hi’) { console.log(message); } say(); // ‘Hi’ say(‘Hello’) // ‘Hello’ Code language: JavaScript (javascript) The default value of the message paramater in the say() function is ‘Hi’. In JavaScript, default function parameters allow you to initialize named…
Read more

JavaScript Recursive Function

JavaScript Recursive Function Summary: in this tutorial, you will learn how to use the recursion technique to develop a JavaScript recursive function, which is a function that calls itself. Introduction to the JavaScript recursive functions A recursive function is a function that calls itself until it doesn’t. And this technique is called recursion. Suppose that…
Read more

Understanding JavaScript Pass-By-Value

Understanding JavaScript Pass-By-Value Summary: this tutorial explains how JavaScript pass-by-value works and gives you some examples of passing primitive and reference values to a function. Before going forward with this tutorial, you should have good knowledge of the primitive and reference values, and the differences between them. JavaScript pass-by-value or pass-by-reference In JavaScript, all function arguments…
Read more

JavaScript Anonymous Functions

JavaScript Anonymous Functions Summary: in this tutorial, you will learn about JavaScript anonymous functions. Introduction to JavaScript anonymous functions An anonymous function is a function without a name. The following shows how to define an anonymous function: (function () { //… }); Code language: JavaScript (javascript) Note that if you don’t place the anonymous function…
Read more

JavaScript Functions are First-Class Citizens

JavaScript Functions are First-Class Citizens Summary: in this tutorial, you’ll learn that JavaScript functions are first-class citizens. This means that you can store functions in variables, pass them to other functions as arguments, and return them from other functions as values. Storing functions in variables Functions are first-class citizens in JavaScript. In other words, you…
Read more

JavaScript Functions

JavaScript Functions Summary: in this tutorial, you will learn about JavaScript functions and how to use them to structure the code into smaller and more reusable units. Introduction to JavaScript functions When developing an application, you often need to perform the same action in many places. For example, you may want to show a message…
Read more

JavaScript Comma Operator

JavaScript Comma Operator Summary: in this tutorial, you’ll learn about the JavaScript comma operator and its usage. Introduction to the JavaScript comma operator JavaScript uses a comma (,) to represent the comma operator. A comma operator takes two expressions, evaluates them from left to right, and returns the value of the right expression. Here’s the…
Read more