当前位置:网站首页>^31原型面试题
^31原型面试题
2022-06-11 16:33:00 【sanda_nd】
1、
function A() {
}
A.prototype.n = 1
var b = new A()
A.prototype = { //A的原型被赋予了新的对象
n: 2,
m: 3
}
var c = new A()
console.log(b.n, b.m, c.n, c.m) //1 undefined 2 3各变量关系如图:

2、
function F(){}
Object.prototype.a=function(){
console.log('a.()')
}
Function.prototype.b=function(){
console.log('b.()')
}
var f=new F()
f.a()
// f.b() 报错
F.a()
F.b()按照图进行寻找即可
红色:隐式传递
蓝色:显式传递
边栏推荐
- pycharm和anaconda的基础上解决Jupyter连接不上Kernel(内核)的问题--解决方案1
- Step 4 of installation in RF: an error is reported when installing the robotframework-selenium 2library
- 2022高压电工特种作业证考试题库及在线模拟考试
- Oracle生成不重复字符串 sys_guid()与Mysql生成唯一值
- Leetcode 450. 删除二叉搜索树中的节点
- 485天,我远程办公的 21 条心得分享|社区征文
- 2022安全员-C证特种作业证考试题库及答案
- How the autorunner automated test tool creates a project -alltesting | Zezhong cloud test
- 【opencvsharp】斑点检测 条码解码 图像操作 图像旋转/翻转/缩放 透视变换 图像显示控件 demo笔记
- 瑞吉外卖项目(三)员工管理业务开发
猜你喜欢

从0到1了解Prometheus

面试高频算法题---最长回文子串

1267_ FreeRTOS starts the first task interface prvportstartfirsttask implementation analysis

Pytest测试框架基础篇

2022g1 industrial boiler stoker test questions and simulation test

Interview high frequency algorithm question --- longest palindrome substring

JVM 的组成

完整的测试流程【杭州多测师】【杭州多测师_王sir】

unittest 如何知道每个测试用例的执行时间

时序预测 | MATLAB实现RBF径向基神经网络时间序列未来多步预测
随机推荐
485 days, 21 experiences of my remote office sharing | community essay solicitation
select into from 和 insert into select 区别
2022起重机司机(限桥式起重机)考试题模拟考试题库及模拟考试
[sword finger offer] 22 The penultimate node in the linked list
项目经理如何击退被工作汇报支配的恐惧感?
大龄码农从北京到荷兰的躺平生活
[learn FPGA programming from scratch -17]: quick start chapter - operation steps 2-5- VerilogHDL hardware description language symbol system and program framework (both software programmers and hardwa
CLP Jinxin helps Rizhao bank put into operation its new financial ecological network
The micro service failed to connect to the cloud sentinel console and the link blank problem occurred after the connection was successful (resolved)
[sword finger offer] 21 Adjust array order so that odd numbers precede even numbers
laravel 8 使用passport 进行Auth验证及颁发token
Laravel8 implementation of sign in function
2022 R1 quick opening pressure vessel operation test question bank and simulation test
消息队列-推/拉模式学习 & ActiveMQ及JMS学习
Heartless sword English Chinese bilingual poem 001 Spring outing
Pyqt5 enables the qplaintextedit control to support line number display
pycharm和anaconda的基础上解决Jupyter连接不上Kernel(内核)的问题--解决方案1
2022安全员-C证特种作业证考试题库及答案
Memory image of various data types in C language
瑞吉外卖项目(三)员工管理业务开发