-
-
Save brunosabot/1c90778188505dc22d9304ca647c6777 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment