Object.values() is similar to Object.entries(), but it returns a one-dimensional array containing only the values of the object’s properties.
const person = { firstName : “John”, lastName : “Doe”, age : 50, eyeColor : “blue” }; let text = Object.values(person); |
The Object.values() method has been supported in all modern browsers since March 2017.
async function myDisplay() { let myPromise = new Promise(function(myResolve, myReject) { setTimeout(function() { myResolve(“I love You !!”); }, 3000); }); document.getElementById(“demo”).innerHTML = await myPromise; } myDisplay(); |
Async functions have been supported in all modern browsers since September 2017.
JavaScript allows trailing commas in places where a comma-separated list of values is used, such as in array and object literals, function calls, parameters, imports, and exports.
function myFunc(x,,,) {}; const myArr = [1,2,3,4,,,]; const myObj = {fname: John, age:50,,,}; |
Trailing commas have been supported in all modern browsers since May 2017.