Should we add a standard for using trailing commas in our JavaScript?
In Arrays?
In Objects?
var object = {
company: "ASH",
team: "Front End",
};
In Functions?
Only works in ecmaVersion 2017
function f(p) {}
function f(p,) {}
(p) => {};
(p,) => {};
In Array and Object Destructuring?
let [a, b,] = [1, 2];
let o = {
p: 42,
q: true,
};
let {p, q,} = o;
Should we add a standard for using trailing commas in our JavaScript?
In Arrays?
In Objects?
In Functions?
Only works in ecmaVersion 2017
In Array and Object Destructuring?