运行原型链代码后 console.log(bob.precip) 输出什么?
What is the result in the console of running the code shown (prototype chain)?
题目类型: 技术面试题
这是一道技术面试题,常见于澳洲IT公司面试中。
难度: medium
分类: JavaScript OOP
标签: prototype, inheritance
参考答案摘要
WinterStorm.prototype.precip 被重写为 'snow' ,实例 bob 会在原型链上找到该属性,因此输出 snow 。
本题提供 STAR 原则详细解答和技术解析,登录匠人学院学习中心即可查看完整答案。