본문 바로가기

핀테크 서비스 프론트엔드 개발자 취업 완성 2기/JS22

[JS] JSON 시작 JSON json은 문자 데이터인데 객체 데이터 처럼 다루어진다. // import myData from './myData.json' const user = { name: 'Flyda', age: 85, emails: [ 'sjdkfsldjf@gamil.com', 'hello@naver.com' ] } console.log('user', user) // { // name: 'Flyda', // age: 85, // emails: [ // 'sjdkfsldjf@gamil.com', // 'hello@naver.com' // ] // } const str = JSON.stringify(user).. 2022. 5. 2.
[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.