javascript
javascript의 선택적 인수 위험
http://www.wirfs-brock.com/allen/posts/166 A JavaScript Optional Argument Hazard A JavaScript Optional Argument Hazard on February 24, 2011 My recent post on testing for negative 0 in JavaScript created a lot of interest. So today, I’m going to talk about another bit of JavaScript obscurity that was also inspired by a Twitter threa www.wirfs-brock.com let test_arr = ['1', '2', '3'] let result_ar..
반복 메서드 정리
- for ... of 특징 : key 값은 요소가 된다. for...of 명령문은 반복가능한 객체 (Array, Map, Set, String, TypedArray, arguments 객체 등을 포함)에 대해서 반복하고 각 개별 속성값에 대해 실행되는 문이 있는 사용자 정의 반복 후크를 호출하는 루프를 생성합니다. let iterable = new Map([["a", 1], ["b", 2], ["c", 3]]); for (let entry of iterable) { console.log(entry); } // [a, 1] // [b, 2] // [c, 3] for (let [key, value] of iterable) { console.log(value); } // 1 // 2 // 3 https://..