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
>
查看全文
相关阅读:
mplayer命令行模式下的使用方法
CentOS安装wireshark
CentOS查看系统信息
测试理论1
单例模式
接口测试
rabbitmq
redis数据库
时间模块
charles抓取数据
原文地址:https://www.cnblogs.com/panyee/p/386984.html
最新文章
c#套料程序设计
winform程序压缩文件上传,服务器端asp.net mvc进行接收解压
system进程占用80端口
如何向外行解释产品经理频繁更改需求为什么会令程序员烦恼?
c#目录以及子目录下图片批量缩放,像素不变,图像大小改变
php等比例压缩图片
c#中RGB与int类型之间的转换
C#编译成以管理员身份运行程序
mysql存储过程的初步学习及案例示例
生鲜配送管理系统_升鲜宝V2.0 价格组功能 操作说明_15382353715
热门文章
生鲜配送管理系统_升鲜宝V2.0 小标签打印功能说明_15382353715
生鲜配送行业,商品管理模块详细设计_【升鲜宝】生鲜配送系统_15382353715_余东升
生鲜配送行业,接地气的销售订单 预订、实发、复核 、收款 流程_【升鲜宝】生鲜配送系统_15382353715_余东升
CentOS 7 yum安装路径查询方法
centos7下快速安装mysql
简单的GCC语法: 弄清gcc test.c 与 gcc -c test.c 的差别
Centos Valgrind 的使用与安装
删除CentOS更新后的旧内核
CentOS7上安装MySQL Workbench
centos安装LightTable
Copyright © 2011-2022 走看看