Skip to content

Instantly share code, notes, and snippets.

@EugeneAZDev
EugeneAZDev / alternative_switch_case.js
Last active October 19, 2022 18:07
Alternative of Switch case approach
// Another approach of Switch case
// Output =>
// Result: () => {
// const r = 1 * 56
// const ar = r - 4
//
// return ar
// }
const first = () => {
const r = 1 * 56
@EugeneAZDev
EugeneAZDev / switch_case.js
Created October 19, 2022 16:48
Switch case sampe
// Could be async function
// Output => Result: 52
function someFunction (args) {
switch (args) {
case 'first':
const r = 1 * 56
const ar = r - 4
return ar
case 'second':