iPod Video White

πŸ““ TIL 49

[220506]πŸ“’ callstack / DOM api

μ½œμŠ€νƒ setTimeout(() => { console.log("timeout"); }, 1000); function a() { console.log("A"); function b() { console.log("B"); } b(); } a(); 큐 내에 μˆœμ„œ micro 1 λΈŒλΌμš°μ €λ§ˆμž 닀름 macro Animation DOM api node vs element node 123 abc element // qeuryselector λŠ” μš”μ†Œλ₯Ό 찾음 const divEl = document.querySelector("div"); // qeuryselectorAll λŠ” nodelist λΌλŠ” λ°°μ—΄ λ°μ΄ν„°μ²˜λŸΌ 생긴 개체λ₯Ό 찾음 //nodelist // Object object const divNodeList = do..

πŸ““ TIL 2022.05.06

[220430] λ°μ΄ν„°μ˜ λΆˆλ³€μ„±κ³Ό κ°€λ³€μ„±

μ›μ‹œν˜• 데이터 μ’…λ₯˜: string number boolean undefined null symbol - λ˜‘κ°™μ€ 값은 μƒˆλ‘œμš΄ λ©”λͺ¨λ¦¬μ— ν• λ‹Ήλ˜μ§€ μ•ŠλŠ”λ‹€. = λ˜‘κ°™μ΄ 생긴 건 λ˜‘κ°™μ€ λ©”λͺ¨λ¦¬ μ£Όμ†Œ μ°Έμ‘°ν˜• 데이터 μ’…λ₯˜: array object function - 같은 값이라도 λ‹€λ₯Έ λ©”λͺ¨λ¦¬μ— 할당될 수 μžˆλ‹€. - κΉŠμ€ 볡사가 ν•„μš”ν•˜λ‹€. let btnEl = document.querySelector("button"); const handler = (event) => { console.log(121); }; btnEl.addEventListener("click", handler); btnEl.removeEventListener("click", handler); btnEl = null; 좜처 패슀트캠퍼슀 λ°•μ˜μ›… κ°•μ‚¬λ‹˜

πŸ““ TIL 2022.04.30

[220419] export / import / lodash / Json

πŸŽ₯ 인강 내보내기 1. Default export - 이름을 μ§€μ •ν•˜μ§€ μ•Šμ•„λ„λŒ -> λ”°λΌμ„œ λ””ν΄νŠΈλ₯Ό import 할땐 이름을 μž„μ˜λ‘œ μ§€μ • κ°€λŠ₯ - ν•˜λ‚˜μ˜ νŒŒμΌμ—μ„œ ν•œκ°œμ˜ λ””ν΄νŠΈλ§Œ μ‚¬μš©κ°€λŠ₯ export default function (date) { return Object.prototype.toString.call(data).slice(8,-1) } 2. Named export - 이름을 κΌ­ μ§€μ •ν•˜μ—¬μ•Όν•¨ - μ—¬λŸ¬κ°œ export κ°€λŠ₯ export function random(){ return Math.floor(Math.random() * 10) } - 이름을 {}에 λ„£μ–΄μ„œ import import {random, user as kmjin } from './getRandom' // as λ₯Ό μ‚¬μš©ν•˜μ—¬ λ‹€λ₯Έ 이..

πŸ““ TIL 2022.04.19

[220418] JS data type

JS 데이터(μžλ£Œν˜•, Date Type) μ›μ‹œν˜• 문자 숫자 뢈린 null undefined 심볼 ν°μ •μˆ˜(BigInt) μ°Έμ‘°ν˜• λ°°μ—΄ 객체 ν•¨μˆ˜ 문자 λ”°μ˜΄ν‘œλ‘œ λ¬Άμ—¬ μžˆμ–΄μ•Ό 함! "Heropy" 'heropy' `heropy` 숫자 NaN : 숫자둜 ν‘œμ‹œκ°€ λΆˆκ°€! (μˆ«μžλ°μ΄ν„°) NaN boolean true false null 값이 μ—†μŒμ„ λͺ…μ‹œμ μœΌλ‘œ λ‚˜νƒ€λ‚Ό λ•Œ μ“°λŠ” κ°’(데이터) undefined 값이 ν• λ‹Ήλ˜μ§€ μ•Šμ€ μƒνƒœλ₯Ό μ•”μ‹œμ μœΌλ‘œ λ‚˜νƒ€λƒ„ 심볼 μœ μΌν•œ μ‹λ³„μž(ID) 데이터 이름을 λ§Œλ“€ λ–Ό μ‚¬μš© const s = Symbol('hello world!') const user = { name: kmjin [s]: 92 } console.log(user.name) console.log(user[s]) BigInt 큰..

πŸ““ TIL 2022.04.18

[220417] Data type / λ‚΄μž₯ λ©”μ†Œλ“œ

λ¦¬ν„°λŸ΄ 방식 νŠΉμ •ν•œ 기호둜 데이터λ₯Ό λ§Œλ“€μ–΄λ‚΄λŠ” 방식 μ›λž˜λŠ” new λΌλŠ” ν‚€μ›Œλ“œλ‘œ 각 μ „μ—­κ°μ²΄λ“€λ‘œ 데이터λ₯Ό λ§Œλ“€μ–΄λƒ„ prototype 문자 str.indexOf(‘heropy’) !== -1 : boolean λ°μ΄ν„°λ‘œ ν•΄λ‹Ή 단어가 μžˆλŠ”μ§€ μ°ΎλŠ” 방법 str.replace( λ°”κΏ€ 문자, 넣고싢은 문자) str.match( ) str.trim() : λ¬Έμžμ—΄μ˜ μ•žλ’€ 곡백 제거 숫자 math : λ‚΄μ • 객체. ν•¨μˆ˜ 객체가 μ•„λ‹˜.. math.floor (math.random() *10) : λžœλ˜ν•œ μ •μˆ˜ λ°°μ—΄ elements == item forEach : μ•„μ΄ν…œμ˜ 갯수만큼 μ½œλ°±λ¬Έμ„ 반볡 λ°˜ν™˜λ˜λŠ” 값은 μ—†μŒ map : μ•„μ΄ν…œμ˜ 갯수만큼 μ½œλ°±λ¬Έμ„ λ°˜λ³΅ν•˜μ—¬ 리턴을 톡해 μƒˆλ‘œμš΄ λ°°μ—΄ 생성 filter : 필터링을 ν•΄μ„œ μƒˆλ‘œμš΄..

πŸ““ TIL 2022.04.18

[220415] switch statement

쑰건의 λ‚΄μš©μ΄ λ”± λ–¨μ–΄μ§€λŠ” νŠΉμ •ν•œ 값일 경우 유용 switch (a) { case 0 : console.log('a is 0') break case 2 : console.log('a is 2') break case 4 : console.log('a is 4') break default : console.log('rest...') } - break κ°€ μ—†μœΌλ©΄ 계속 μ‹€ν–‰λ˜κΈ° λ•Œλ¬Έμ— ν•œ μΌ€μ΄μŠ€κ°€ λλ‚œ ν›„μ—λŠ” μ‚¬μš©ν•΄μ•Ό 함 - defalt μœ„μ— 쑰건이 λͺ¨λ‘ 아닐 경우 μ‹€ν–‰

πŸ““ TIL 2022.04.15

[220412] μŠ€νƒ€λ²…μŠ€ 예제

배치 - 외뢀여백을 μžλ™μœΌλ‘œ 계산 κ°€λŠ₯ν•˜κ²Œ - μš”μ†Œ λ„ˆλΉ„κ°€ λͺ…μ‹œλ˜μ–΄ μžˆμ–΄μ•Όν•¨ - μ–‘ 끝점을 μœ„μΉ˜ 기쀀을 μž‘μ•„μ£Όκ³  material icons link 둜 μ—°κ²° ν›„ 클래슀λͺ… meterial-icons 을 κ°€μ§„ μš”μ†Œ λ‚΄μš©μ— μ•„μ΄μ½˜ 이름을 λ„£μœΌλ©΄ μ‚¬μš©κ°€λŠ₯ κ°€μƒμš”μ†ŒλŠ” μΈλΌμΈμš”μ†Œ μŠ€νƒ€μΌμ„ ul에 μ μš©ν•˜λŠ”κ±°λž‘ li 에 μ μš©ν•˜λŠ” 것에 차이? container λž‘ item 차이?? BEM μš”μ†Œ__일뢀뢄 μš”μ†Œ-μƒνƒœ

πŸ““ TIL 2022.04.12
λ°˜μ‘ν˜•