const method1 = () => console.log('Does something'); const method2 = () => console.log('Does another thing'); const method3 = () => console.log('Does entirely other thing'); const switchObj = { a: method1, b: method2, c: method3 }; const init = (option) => { console.log('instead of switch case, use an object'); console.log(switchObj[option]()); } init('a');