map2 Refactoring javascript 1 Clean coding in JavaScript 리팩토링 자바스크립트, 클린 코드 작성하기 Using the map function before const myList = list => { const newList = [] for (let i = 0; list.length; i++) { newList[i] = list[i] * 2 } return newList } after const myList = list => list.map(x => x * 2) Avoid callback hell with async/await before const sendToEmail = () => { getIssue().then(issue => { getOwner(issue.ownerId).then(owner => { send.. 2020. 9. 23. JS Map, Filter, Reduce How to properly use Javascript Map, Filter, and Reduce 자바스크립트 고차함수 map, filter, reduce 사용하기 Sample Player list Array const players = [ { id: 10, name: "Jan Vertonghen", status: "Goal keeper", totalMatch: 400, retired: true, }, { id: 2, name: "Paulo Wanchope", status: "Attacker", totalMatch: 200, retired: false, }, { id: 41, name: "Ronny Johnsen", status: "Goal keeper", totalMatch: 300, retired: .. 2020. 9. 21. 이전 1 다음