본문 바로가기

JavaScript9

[Hello WM] Responsive Web Responsive web page : Hello WM 2021.07.19 ~ 2021.08.09 https://hello-WM.vercel.app HTML, Sass, JavaScript PREVIEW [후기] 생각보다 오래 걸렸다... 다른 강의 들으면서 틈틈히 하려고 했는데 하기 싫을 땐 그냥 건너뛰기도 하고 그래서 그런 듯. 이번 프로젝트 하면서 느낀 건, HTML, CSS, JavsScript 모두 연결고리이기 때문에 하나라도 어긋나면 HTML부터 다시 가서 코드를 짜야한다는 것. 아무 것도 없는 상태에서 디자인을 구상하고 실제로 적용해보고 스타일을 입히고, 자바스크립트까지 적용시키는 건 생각보다 오래 걸렸다. HTML 골격을 잡을 때부터 조금 더 철저하게 계획을 세워가며 해야겠다고 깨달은 이번.. 2021. 8. 9.
[JS] Operations with Dates udemy, The Complete JavaScript Course 2021: From Zero to Expert! JavaScript에서 제공하는 Date objects 활용하기 const formatMovementDate = function (date) { const calcDayPassed = (date1, date2) => (date2 - date1) / (1000 * 60 * 60 * 24); const dayPassed = Math.round(Math.abs(calcDayPassed(date, new Date()))); if (dayPassed === 0) return 'Today'; if (dayPassed === 1) return 'Yesterday'; if (dayPassed (date2.. 2021. 6. 30.
[JS] Array Methods Practice udemy, The Complete JavaScript Course 2021: From Zero to Expert! string을 Title case capitalization 하는 함수 만들기 // this is a nice title -> This Is a Nice Title const convertTitleCase = function (title) { const capitalized = str => str.replace(str[0], str[0].toUpperCase()); const exceptions = ['a', 'an', 'the', 'and', 'but', 'with', 'on', 'in']; const titleCase = title .toLowerCase() .split(' ') .ma.. 2021. 6. 30.
[JS] Avoid callback hell, Promise udemy, The Complete JavaScript Course 2021: From Zero to Expert! / Teacher: Jonas Schmedtmann Promise chain을 사용하는 목적은 Callback HELL에서 벗어나기 위함이다. Promise : An object that is used as a placeholder for the future result of an asynchronous operation. 'AJAX call과 같은 미래에 받을 값을 담아놓는 상자' 정도로 이해하면 될 거 같다. setTimeout(() => { console.log('1 second passed'); setTimeout(() => { console.log('2 seconds passed'.. 2021. 6. 20.
[JS] Object-Oriented Programming (OOP) Object-Oriented Programming (OOP) was developed with the goal of organizing code, to make it more flexible and easier to maintain (avoid 'spagetti code') - 최근에 SW 엔지니어링에서 가장 많이 쓰임. 죽 늘여놓는 코드를 쓰지 않고 정리할 수 있도록 해주며 유지보수를 쉽게 할 수 있다. [3 Ways of implementing prototypical inheritance in Javascript] 1) Constructor function 2) ES6 Classes : 쓰이는 코드의 방식이 constructor function과 매우 흡사하다. 3) Object.create() Th.. 2021. 6. 16.