-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
refactorRefactoring production codeRefactoring production code
Description
- 현재: null을 사용하지 않고, undefined만 사용
- 변경: undefined를 사용하지 않고, null을 사용하도록 함
한번 undefined만 사용해봤는데 생각보다 애매함.
- 타입 정의할땐 편함. 있을 수도 있고, 없을 수도 있으면 그냥 ?: 로 타입 선언하면 됨.
- 파라미터 정의할때도 편함. ?:로 선언하면 됨.
- 자바스크립트 자체 함수가 undefined를 반환할 때가 많음. 이때 같이 호환돼서 편함
- 근데 이거 외에는 별로인 것 같음
- 대표적으로 함수 인자나 props 같은 경우 이게 사용자 실수로 인자를 빠뜨린건지, undefined를 유도해서 빠뜨린건지 확인할 방도가 없음.
- 그래서 코드가 굉장히 불확실함
Metadata
Metadata
Assignees
Labels
refactorRefactoring production codeRefactoring production code