728x90

프론트엔드/Javascript 연습과제 해답 20

자바스크립트 문법 1 - 변수(Variable)와 자료형(Data Type) 해답

* 연습과제 1~3 let sofaPrice = 360000 let sizeOfShoes = 275 const PI = 3.14 * 연습과제 4 const name = "sunrise" const message = "Happy halloween, " // 구현하기 console.log(message + name) console.log(`${message} ${name}`) * 연습과제 5 const letter = 'Dear syleemomo. \n\ Hello, syleemomo ^^ \n\ My name is kiki. Your sincere friend \n\ How are you thesedays? \n\ Are you busy or not? \n\ I guess you haven\'t sleep..

자바스크립트 문법 5 - 이벤트(Event) 처리하기 3 해답

* 연습과제 1~3 보여주고자 하는 4개의 사진이 필요함 body{ height: 200vh; } #section{ display: flex; justify-content: center; align-items: center; margin-top: 400px; } .contents{ background-color: brown; width: 300px; height: 300px; text-align: center; line-height: center; margin-right: 10px; opacity: 0; transition: all .5s ease; overflow: hidden; } .contents img{ width: 100%; height: 100%; } .up{ /* y 좌표를 아래쪽으로 100..

자바스크립트 문법 4 - 이벤트 (Event) 처리하기 2 해답

* 연습과제 1 body{ margin: 0; padding: 0; background: #0e1111; } .color-box{ background-color: #0e1111; position: absolute; left: 0; top: 0; width: 100%; height: 100vh; } #color-input{ all: unset; width: 300px; height: 50px; border: 2px solid lightgreen; padding: 10px; border-radius: 15px; color: lightgreen; font-size: 1.2rem; font-weight: bold; position: absolute; left: 50%; top: 50%; transform: tr..

자바스크립트 문법 3 - 이벤트(Event) 처리하기 해답

* 연습과제 1 랜덤으로 타일의 색상 변경하기 body{ padding: 0; margin: 0; display: flex; justify-content: center; align-items: center; flex-direction: column; } #tile-container{ width: 600px; height: 600px; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; } .tile{ width: 200px; height: 200px; box-sizing: border-box; border: 1px solid skyblue; } const tiles = document.querySelectorAll('..

자바스크립트 문법 9 - 배열(Array) 의 다양한 메서드 3 (분해와 융합) 해답

* 연습과제 1 해답 1 const friends = [ {name: 'victoria', age: 13, city: 'seoul'}, {name: 'sun', age: 34, city: 'busan'}, {name: 'johseb', age: 25, city: 'busan'}, {name: 'syleemomo', age: 9, city: 'seoul'}, {name: 'hannah', age: 41, city: 'daegu'}, {name: 'shara', age: 37, city: 'seoul'}, {name: 'martin', age: 28, city: 'daegu'}, {name: 'gorgia', age: 39, city: 'seoul'}, {name: 'nana', age: 24, city: ..

자바스크립트 문법 8 - 배열(Array)의 다양한 메서드 2 (변경과 정렬) 해답

* 연습과제 1 const userName = document.getElementById('user-name') const userEmail = document.getElementById('user-email') const userAge = document.getElementById('user-age') const userList = document.getElementById('user-list') const submitBtn = document.getElementById('user-add') const users = [] function isValid(str){ return str !== '' && str !== undefined } function buildElement(user){ const use..

자바스크립트 문법 7 - 배열(Array)의 다양한 메서드 1 (검색과 조회) 해답

* 연습과제 1 const lyrics = ` Sorry Sorry Sorry Sorry 내가 내가 내가 먼저 네게 네게 네게 빠져 빠져 빠져 버려 baby Shawty Shawty Shawty Shawty 눈이 부셔 부셔 부셔 숨이 막혀 막혀 막혀 내가 미쳐 미쳐 baby 바라보는 눈빛 속에 눈빛 속에 나는 마치 나는 마치 뭐에 홀린 놈 이젠 벗어나지도 못해 걸어오는 너의 모습 너의 모습 너는 마치 내 심장을 밟고 왔나봐 이젠 벗어나지도 못해 어딜 가나 당당하게 웃는 너는 매력적 착한 여자 일색이란 생각들은 보편적 도도하게 거침 없게 정말 너는 환상적 돌이킬 수 없을만큼 네게 빠져 버렸어 Sorry Sorry Sorry Sorry 내가 내가 내가 먼저 네게 네게 네게 빠져 빠져 빠져 버려 baby Sh..

728x90