Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions 3rd/10번/10.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,13 @@ const 사람들 = [
];

// 여기에 코드를 작성해주세요.
const 나이10살더먹은사람들 = 사람들.?
const 나이10살더먹은사람들 = 사람들.map(function (사람) {
return {
이름: 사람.이름,
나이: 사람.나이 + 10,
성별: 사람.성별,
};
});

console.log(나이10살더먹은사람들);
// 결과
Expand All @@ -33,4 +39,4 @@ console.log(나이10살더먹은사람들);
{ '이름': '김유리', '나이': 32, '성별': '여' },
{ '이름': '김맹구', '나이': 33, '성별': '남' }
]
*/
*/
2 changes: 1 addition & 1 deletion 3rd/11번/11.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const 사람들 = [
];

// 여기에 코드를 작성해주세요.
const 나이20살이상사람들 = 사람들.?
const 나이20살이상사람들 = 사람들.filter((사람) => 사람.나이 >= 20);

console.log(나이20살이상사람들);
// 결과
Expand Down
6 changes: 3 additions & 3 deletions 3rd/12번/12.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ const 투두 = {
};

// 여기에 코드를 작성해주세요.
const newTodo = ?
const newTodo = { ...투두, 완료여부: true };

console.log(투두)
console.log(투두);
console.log(newTodo);
// 결과
// { id: 1, '할일': '8시기상', '완료여부': false }
// { id: 1, '할일': '8시기상', '완료여부': true }
// { id: 1, '할일': '8시기상', '완료여부': true }
2 changes: 2 additions & 0 deletions 3rd/1번/1.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
### Array(배열)가 필요한 이유가 무엇인가요?

(여기에 작성)

다수의 데이터를 간결한 코드로 저장하고 처리할 수 있어 효율적이기 때문이다.
2 changes: 1 addition & 1 deletion 3rd/2번/2.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const 배열 = ["예병수", "류제천", "이재상", "최원장"];

// 배열에서 예병수를 출력하는 방법은?
console.log();
console.log(배열[0]);
6 changes: 5 additions & 1 deletion 3rd/3번/3.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
const 배열 = ["예병수", "류제천", "이재상", "최원장"];

const new배열 = 배열.map((a) => {
return `${a} 튜터`;
});

// ["예병수 튜터", "류제천 튜터", "이재상 튜터", "최원장 튜터"]
console.log(배열);
console.log(new배열);
6 changes: 6 additions & 0 deletions 3rd/4번/4.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## Object(객체)와 Array(배열)의 차이를 정리해보세요.

(여기에 작성하세요)

객체는 {} 중괄호를 사용하여 작성하며, key와 value로 이루어져 있다.
객체는 관련된 데이터를 한 번에 관리하기 위해 쓰여진다.

배열은 [] 대괄호를 사용하여 작성하며, 대괄호 사이에 데이터를 넣으면 된다.
배열은 여러 개의 데이터를 한 번에 저장하고 싶을 때 사용된다.
2 changes: 1 addition & 1 deletion 3rd/5번/5.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ const 객체 = {
};

// 객체에서 직업이라는 key로 접근해보세요.
console.log();
console.log(객체.직업);
2 changes: 1 addition & 1 deletion 3rd/6번/6.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ const 객체 = {
};

// 나이라는 객체를 100 -> 20으로 수정하고 출력해보세요.

객체.나이 = 20;
console.log(객체);
4 changes: 4 additions & 0 deletions 3rd/7번/7.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
const 배열 = ["가", "나", "다", "라"];

배열.forEach((여기) => {});

// 배열의 각 요소가 들어간다.
// 차례대로 "가", "나", "다", "라"가 들어간다.
// "여기"에 적어 넣는 이름으로써는 아무거나 넣을 수 있다.
4 changes: 4 additions & 0 deletions 3rd/8번/8.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,7 @@ const 튜터님들 = [
최원장님의 담당반은 B입니다.
이재상님의 담당반은 B입니다.
*/
튜터님들.forEach(function (튜터님) {
result = `${튜터님.이름}님의 담당반은 ${튜터님.담당반}입니다.`;
console.log(result);
});
8 changes: 5 additions & 3 deletions 3rd/9번/9.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@ const 사람들 = [
];

// 여기에 코드를 작성해주세요.
const 나이20살이상한명 = 사람들.?
const 나이20살이상한명 = 사람들.find(function (사람) {
return 사람.나이 > 20;
});

console.log(나이20살이상한명)
console.log(나이20살이상한명);
// 결과
// { '이름': '김유리', '나이': 22, '성별': '여' }
// { '이름': '김유리', '나이': 22, '성별': '여' }