zoukankan
html css js c++ java
prototype理解
<
script
>
function
aa()
{
this
.x
=
5
;
this
.y
=
6
;
//
内部定义的函数只有实例化后才可以使用
this
.test
=
function
(a)
{
alert(a
+
"
,
"
+
this
.x
+
"
,
"
+
this
.y);
}
}
//
prototype定义的函数未实例化就可以取得指针
aa.prototype.pany
=
function
(a)
{
alert(a
+
"
,
"
+
this
.x);
}
alert(aa.test);
alert(aa.prototype.test);
alert(aa.pany);
alert(aa.prototype.pany);
window[
"
Hello
"
]
=
aa;
aa.prototype[
"
MyAlert
"
]
=
aa.prototype.pany;
var
xx
=
new
Hello();
xx.MyAlert(
"
0
"
);
xx.pany(
"
1
"
);
//
xx.test(
"
2
"
);
</
script
>
查看全文
相关阅读:
图片音乐 上传、下载
表格类型数据,Excel csv导入,导出操作
逐行读取txt文件,分割,写入txt。。。上传,下载
性能分析四
性能分析三
postman断言
postman+Newman语法参数
shell_03
shell_02
shell_01
原文地址:https://www.cnblogs.com/panyee/p/386984.html
最新文章
Redis详解(6)--redis持久化
Redis详解(5)--redis数据类型实现原理
jenkins分布式配置方式
pytest之参数化parametrize的使用
pytest之mark的使用
pytest介绍、安装及如何自动识别测试用例
records库操作SQL查询MySQL数据库
python json模块中dumps、dump、loads、load函数介绍
python中httprunner的使用
打印斐波那契数列前10位数字
热门文章
打印正整数n之内的斐波那契数列
压测过程中修改注册表的方法
常见的运行时异常与编译时异常举例
(PASS)java中nextInt()函数
逻辑训练题
面试题: 逻辑思维题 (????)
冒泡排序 和 鸡尾酒排序的区别 ?
Dijkstra算法举例分析
二叉树基础知识小结
带你彻底理解RSA算法原理,很简单的
Copyright © 2011-2022 走看看