js if문 중첩 없애기
//원본 function test() { let result = ''; if (a) { if(!b) { result = 'c'; } } else { result = 'a'; } result += 'b'; return result; } //줄인 코드 function test() { let result = ''; if (!a) { result = 'a'; re...
- 좋아요수
- 0
- js
//원본 function test() { let result = ''; if (a) { if(!b) { result = 'c'; } } else { result = 'a'; } result += 'b'; return result; } //줄인 코드 function test() { let result = ''; if (!a) { result = 'a'; re...