const defaults = { debug: true }; const data = { ...defaults, output: "json" }; console.log(data); // {debug: true, output: "json"} const data2 = { ...defaults, debug: false, output: "json" }; console.log(data2); // {debug: false, output: "json"} const data3 = { debug: false, output: "json", ...defaults }; console.log(data3); // {debug: true, output: "json"}