ECMA-262 had three revisions from 1997 to 1999, but nearly 10 years later, version 4 was abandoned due to disagreements on the direction of the language and features. Many of modern features, such as generators, iterators, and destructuring assignments, arrow function, classes … have been included in more recent ECMAScript specifications. The latest edition is 11th, officially known as ECMAScript 2020, was published in June 2020. One of the features of ECMAScript 2020 is the nullish coalescing operator,
??, returns its right-hand side operand when its left-hand side is
undefined. This contrasts with the
|| operator, which uses the right value if left-hand side is falsy
console.log(true ?? "not defined") // true console.log(false ?? "not defined") // false console.log(undefined ?? "not defined") // "not defined" console.log(null ?? "not defined") // "not defined" //Compared with the OR operator || console.log(true || "not defined") // true console.log(false || "not defined") // "not defined" console.log(undefined || "not defined") // "not defined" console.log(null || "not defined") // "not defined"
What is PHP: - Who invented PHP, how it works, answers to all such questions about PHP, and much other information, you are going to