bettercode

    [better code] if else, case 안쓰고 분기하는법

    개발을 하던중 특정조건에 따라 if else 나 case문으로 분기를 하는 경우가 종종있었는데 항상 보기가 안좋았고 다른 방법이 없을까 고민을 했었다 const processFunc = reqire('./processFunctions'); . . . switch(type){ case 'printing' : processFunc.printingCaseFunc(); break; case 'cutting' : processFunc.cuttingCaseFunc(); break; case 'molding' : processFunc.moldingCaseFunc(); break; case 'sheeting' : processFunc.sheetingCaseFunc(); break; case 'design' : proc..