JS2 [JS] Date를 이용한 날짜 및 요일 구하기 function get_date() { let year = "" let month = "" let day = "" let weekday = "" const WEEKDAY = ['일요일', '월요일', '화요일', '수요일', '목요일', '금요일', '토요일'] let current_date = new Date(); year = String(current_date.getFullYear()); month = String(current_date.getMonth() + 1); day = String(current_date.getDate()); weekday = WEEKDAY[current_date.getDay()] return year + "년 " +.. 2024. 5. 27. [JavaScript] numeric separator 천 단위를 언더바로 구분 큰 숫자의 가독성을 높혀준다. let value = 1000000; value === 1_000_000; // True let amount = 0.000_001; // 0.000001 또한 2진수, 16진수, 8진수에도 사용 가능하다. const octalValue = 0o32_11; // 1673 const hexValue = 0xff_53_00; // 16732928 const binaryValue = 0b1100_1001_1010; // 3226 python, java, C++ 등에서도 지원한다고 한다! 2023. 2. 1. 이전 1 다음