JavaScript - 문제 미리보기

문제 131

easy
다음 코드의 결과는?

```javascript
const person = { name: "Leo", age: 33 };
let x = "name";
let y = "age";
console.log(person[x] + " is " + person[y] + " years old.");
```
A. `name is age years old.`
B. `Leo is 33 years old.`
C. `undefined is undefined years old.`
D. `"name" is "age" years old.`

정답: B

person[x] → person["name"] = "Leo", person[y] → person["age"] = 33, 결과는 "Leo is 33 years old."입니다.

💡 학습 팁

이 문제를 포함한 JavaScript 과목의 모든 문제를 순차적으로 풀어보세요. 진행상황이 자동으로 저장되어 언제든지 이어서 학습할 수 있습니다.