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

middle

Khi nào cần sử dụng asyncdefer trong javascript?

junior

Kết quả đoạn code sau là gì? Và hãy giải thích?

middle

Sự khác nhau giữa bind, callapply trong Javascript là gì?

Bình luận

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

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