-
Notifications
You must be signed in to change notification settings - Fork 13
Open
Labels
Description
Should we add a standard for using trailing commas in our JavaScript?
In Arrays?
var arr = [ 1, 2, 3, ];
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;