Câu hỏi phỏng vấn Javascript
Câu hỏi

Kết quả đoạn code javascript sau là gì và giải thích tại sao?

Câu trả lời

javascript Copy
  function compareMembers(person1, person2 = person) {
    if (person1 !== person2) {
      console.log("Not the same!");
    } else {
      console.log("They are the same!");
    }
  }
  const person = { name: "Lydia" };
  compareMembers(person);
  • A: Not the same!
  • B: They are the same!
  • C: ReferenceError
  • D: SyntaxError

Đáp án: B

Objec...

middle

middle

Gợi ý câu hỏi phỏng vấn

entry

Javascript có các kiểu dữ liệu nào? Bạn biết gì về chúng

expert

JavaScript truyền tham số theo kiểu tham chiếu (pass by references) hay theo kiểu tham trị (pass by values)?

middle

DOM là gì?

Bình luận

Chưa có bình luận nào

Chưa có bình luận nào