Created
August 17, 2021 10:23
-
-
Save DimitryDushkin/c2b3344eec08e8d111df24390863a8f3 to your computer and use it in GitHub Desktop.
JS assign a variable to switch result
This file contains hidden or 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 result = (function () { | |
switch (step) { | |
case Step.One: | |
return {one: 1}; | |
case Step.Two: | |
return {two: 2}; | |
case Step.Three: | |
return {three: 4}; | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment