본문 바로가기

KDT핀테크프론트엔드개발자2기34

[JS] regeneratorruntime is not defined 에러 해결 방법. main.html More.. main.js const moviesEl = document.querySelector('.movies') const anotherMoviesEl = document.querySelector('.another-movies') getMovie(1, moviesEl) getMovie(1, anotherMoviesEl) const btnEl = document.querySelector('button') btnEl.addEventListener('click', () => { getMovie(2, moviesEl) }) async function getMovie(page, containerEl) { const { data } = await axios({ url: `https://www.. 2022. 5. 2.
[JS] Lodash (_.) Lodash import _ from 'lodash' const usersA = [ {userId: '1', name: 'HEROPY'}, {userId: '2', name: 'NEO'} ] const usersB = [ {userId: '1', name: 'HEROPY'}, {userId: '3', name: 'AMY'} ] const usersC = usersA.concat(usersB) console.log('concat', usersC) //[{"userId":"1","name":"HEROPY"},{"userId":"2","name":"NEO"},{"use.. 2022. 4. 28.
[JS] 데이터 - 객체 Object 객체 Object.assign() 정적 메서드이다. 그래서 객체에 직접 못사용함!! Object.assign() 메서드는 출처(source) 객체들의 모든 열거 가능한 자체 속성을 복사해 대상(target) 객체에 붙여 넣는다. 그 후 대상 객체를 반환한다. const target = { a: 1, b: 2 }; const source = { b: 4, c: 5 }; const returnedTarget = Object.assign(target, source); console.log(target); // expected output: Object { a: 1, b: 4, c: 5 } console.log(returnedTarget); // expected output: Object { a: 1, b: 4.. 2022. 4. 26.
[JS] 데이터 - 구조 분해 할당 ( 객체, 배열) 구조 분해 할당 (비구조화 할당) 객체 const user= { name: 'flyda', age: 85, email: 'dlapdlf@gamil.com' } const {name, age, email, address} = user console.log(`사용자 이름 ${name}`)//사용자 이름 flyda console.log(`사용자 나이 ${age}`)//사용자 나이 85 console.log(`사용자 이메일 ${email}`)//사용자 이메일 dlapdlf@gamil.com console.log(`사용자 주소 ${address}`)//사용자 주소 undefined //정의되어 있지 않으면 undefined // user.address와 user['address'] 같이 인덱싱 방식으로도 사용할 .. 2022. 4. 26.