Last active
January 2, 2018 21:28
-
-
Save bkinsey808/5d1089c948ed9eb2bd2e6a32bfbb50cd 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
// consider the following case | |
let a, b, c | |
if (condition) { | |
a = 1 | |
b = 2 | |
c = 3 | |
} | |
// how would this be refactored into constantly const? | |
const [a, b, c] = condition | |
? [1, 2, 3] | |
: [undefined, undefined, undefined] | |
// or maybe | |
const {a, b, c} = condition | |
? { a: 1, b: 2, c: 3} | |
: { a: undefined, b: undefined, c: undefined } | |
// again, i run into a case like this so infrequently (or maybe never) | |
// so it really doesn't have much bearing for me. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment