Skip to content

Instantly share code, notes, and snippets.

@DimitryDushkin
Created August 17, 2021 10:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DimitryDushkin/c2b3344eec08e8d111df24390863a8f3 to your computer and use it in GitHub Desktop.
Save DimitryDushkin/c2b3344eec08e8d111df24390863a8f3 to your computer and use it in GitHub Desktop.
JS assign a variable to switch result
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