<!---------------------------------------------
1、演示匿名加载
2、js单进程执行流
3、原型链理解
a、__proto__:属性每个对象都有
b、prototype:类型本身
heidsoftg@gmail.com
---------------------------------------------->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<script type="text/javascript">
// (function(){
// console.info(this);
// console.info(arguments);
// }(window)); // (function(){
// console.info(this);
// console.info(arguments);
// })(window);
//
console.log(window);
console.log("Step=========================================1");
(window);//传入参数
(function(a,b){
console.log("a="+a);
console.log("b="+b);
});
console.log("Step=========================================2");
(function(aObject,bObject){
console.log("aObject="+aObject);
console.log("bObject="+bObject);
})(window); console.log("Step=========================================3");
(function(aWin,bUndefined){
console.log("aWin="+aWin);
console.log("bUndefined="+bUndefined);
})(window,undefined);
console.log("Step=========================================4");
(function(aWin,undefined){
undefined="fuck undefined....";
console.log("aWin="+aWin);
console.log("undefined="+undefined);
})(window); console.log("Step=========================================5");
var testObject1={a:1,b:2};
console.log("Step=========================================6");
console.log(testObject1.__proto__);
console.log("Step=========================================7");
console.log(testObject1.__proto__);
testObject1.__proto__ = new Object({a:2,b:5});
console.log("Step=========================================8");
console.log(testObject1.prototype);
console.log("Step=========================================9");
console.log(testObject1);
testObject1.prototype= new Object({a:2,b:5});
console.log("Step=========================================10");
console.log(testObject1); var Person = function(){}; Person.prototype.Say= function(){
alert("Person say");
}; Person.prototype.Salary=50000;
var Programmer = function(){};
Programmer.prototype=new Person();//var p1.__proto__=Person.prototype
Programmer.prototype.WriteCode = function(){
alert("programmer write code");
}; Programmer.prototype.Salary=500;
var p = new Programmer();
//p.__proto__=Programmer.prototype;
//Programmer.prototype.__proto__=Person.prototype;
//p.__proto__.__proto__=Person.prototype p.Say();
p.WriteCode();
alert(p.Salary); </script>
</head>
<body> </body> </html>

最新文章

  1. 前端学HTTP之基本认证
  2. C# Socket异步聊天例子
  3. Qt 使用sqlserver
  4. shell用到的命令
  5. [FlashPlyaer] FP版本20.0.267对Win10的64位系统的不兼容问题
  6. SoapUI-x64(app:url请求参数)
  7. POJ2524+并查集
  8. ContextSwitchDeadlock was detected Message(读取注册表时出现).
  9. Memcached在.net中的应用
  10. (大数据工程师学习路径)第二步 Vim编辑器----查找替换
  11. html5获取用户当前的地理位置,即经纬度。
  12. iptables 学习
  13. 1. 初识 Lucene
  14. 彻底搞懂spark的shuffle过程(shuffle write)
  15. java工程师的成长历程
  16. STRANS一:简单的XML转换
  17. verilog中24LC04B iic(i2c)读写通信设计步骤,以及程序常见写法错误。
  18. windows 安装tensorflow
  19. Web Service 与WebAPI 的区别
  20. Oracle DBA神器之Toad

热门文章

  1. numa对MySQL多实例性能影响
  2. tkprof 解释
  3. HDU 5289 Assignment (数字序列,ST算法)
  4. highcharts 柱状图动态设置数据应用实例
  5. 关于web安全
  6. js如何判断是否在iframe中及防止网页被别站用 iframe嵌套 (Load denied by X-Frame-Options)
  7. JS实现连接方式的菜单
  8. 白盒测试之gmock入门篇
  9. Oracle中表结构和表内容复制
  10. 【windows核心编程】一个API拦截的例子