JavaScript Function Parameters

Learn the basics of JavaScript Function Parameters. A function in JavaScript can accept one or more parameters. Let’s look at some examples: const doSomething = () => { //do something } const doSomethingElse = (foo) => { //do something } const doSomethingElseAgain = (foo, bar) => { //do something } Starting from ES6/ES2015, functions can have default values for their parameters. Here’s an example: const doSomething = (foo = 1, bar = 'hey') => { //do something } This allows you to call the function without specifying all the parameters:...

The Complete ECMAScript 2015-2019 Guide

ECMAScript, often referred to as ES, is the standard on which JavaScript is based. In this guide, we will explore everything you need to know about ECMAScript and its latest features. What is TC39 TC39 is the committee responsible for evolving JavaScript. Its members consist of companies involved in JavaScript and browser vendors, including Mozilla, Google, Facebook, Apple, Microsoft, Intel, PayPal, SalesForce, and others. To propose a new standard version, it must go through various stages, all of which are explained here....

The ES2018 Guide: Features and Upgrades Explained

ECMAScript, often abbreviated as ES, serves as the standard on which JavaScript is based. The latest version of this standard is ES2018, also known as ES9. In this guide, we will explore the new features and upgrades introduced in ES2018. Rest/Spread Properties ES6 introduced the concept of the rest element for array destructuring and spread elements for spreading array elements. ES2018 extends this concept to objects. Rest properties allow you to extract and assign the remaining properties of an object to a new object:...

Working with Objects and Arrays Using Rest and Spread

Learn two modern techniques for working with arrays and objects in JavaScript. You can expand an array, object, or string using the spread operator .... Let’s start with an example for arrays: const a = [1, 2, 3]; To create a new array, you can use: const b = [...a, 4, 5, 6]; You can also create a copy of an array using: const c = [...a]; This also works for objects....