반응형 typescript date1 [TypeScript] TypeScript에서 new Date() 사용하기 디데이를 계산하는 함수를 작성하는 도중에 3번째 줄에서 타입스크립트 에러가 발생하였다.const targetDay = new Date(date);const today = new Date(Date.now() + KOREA_TIME_DIFFERENCE);const dayGapMillis = today - targetDay; // today와 targetDay에 붉은선이 생겼다.const dayGap = Math.floor(dayGapMillis / ONE_DAY_MILLISECONDS);today와 targetDay를 뺄셈하는 도중에 발생한 에러 내용은 다음과 같다: The left-hand side of an arithmetic operation must be of type 'any', 'number', .. 2024. 5. 21. 이전 1 다음 반응형