JS : Profile Lookup (output ตรงตาม hint แต่ไม่ผ่าน)

run test แล้ว output ตรงตาม hint แต่ไม่ผ่าน ผมคิดว่าตัวเองต้องผิดอะไรซักอย่าง ขอเงื่อนงำทีเพราะมีคนผ่านข้อนี้ไปแล้ว รบกวนดู code ผมก็ได้ครับ

var checkName = 0;
var i = 0;

while (i < contacts.length && checkName != 1) {
if (contacts[i].firstName == name) {
checkName = 1;
if (contacts[i].hasOwnProperty(prop)) {
console.log(contacts[i][prop]);
} else {
console.log(“No such property”);
}
}
i++;
}

if (checkName == 0) {
console.log(“No such contact”);
}

เปลี่ยน console.log(contacts[i][prop]) เป็น return contacts[i][prop]
เปลี่ยน console.log(“No such property”) เป็น return "No such property"
เปลี่ยน console.log(“No such contact”) เป็น return "No such contact"

ก็น่าจะผ่านแล้วครับ

ขอบคุณครับ ได้ผลจริง ๆ ด้วย
จากการไปอ่านที่ StackOverFlow มีคนแสดงความเห็นว่า “console.log คือ การ print ส่วน return คือ การส่งค่ากลับ Error ของผมน่าจะเกิดจาก Editor ไม่มีค่าให้ตรวจสอบครับ”