Conditionally add properties inside Object in Javascript
const cond = false;
const obj = {
...(cond ? {a: 1} : {}),
b: 2,
};
// {b: 2}
const cond = false;
const obj = {
...(cond ? {a: 1} : {}),
b: 2,
};
// {b: 2}
World Wide Web
In web application development, using Angular as a reference framework,…
Description Create Node.js project which compiles SASS file to minfied…
VLC shows wrong cover art because it caches images and…
Extensions