Created
March 14, 2024 16:37
-
-
Save thewisenerd/c805d7d8e3fa1ac23f9925001757bb3d 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 = { | |
'a': 1 | |
}; | |
const foo = (flag = false) => { | |
let headers: any = defaults; | |
if (flag) { | |
headers['b'] = 2; | |
} | |
return headers; | |
} | |
console.log(foo()); | |
console.log(foo(true)); | |
console.log(foo()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment