<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body> </body>
<script> function show() { console.log(this)
} show(); //window object
new show(); //object j = {
name:'ldq',
age:18,
info:function () {
console.log(`我的名字是${name},我的年龄是${age}`)
console.log(123)
}
};
console.log(j);
new j.info(); function show(name,age) {
//系统偷偷替我们做了
// var this = new object(); this.name = name;
this.age = age;
this.fun1=function () {
console.log(`我的名字是${this.name},我的年龄是${this.age}`) // /系统偷偷替我们做了
// return this }
}
obj = new show('ldq',18)
obj.fun1()
</script>
</html>

最新文章

  1. jQuery基础_2
  2. DataTable 中varchar 转换为 Double 后重新 排序。
  3. Install and configure Intel NIC teaming on R420
  4. MFC应用程序创建窗口的过程 good
  5. 建造者模式-&gt;代码示例
  6. HDU Good Numbers (热身赛2)
  7. cocos2dx之lua项目开发中MVC框架的简单应用
  8. Portlet开发入门实例
  9. iOS开发之虾米音乐频道选择切换效果分析与实现
  10. 分布式事物(同样适用于dubbo事务等分布式事务)
  11. win10更新后出现System.ComponentModel.Win32Exception
  12. Android--UI之ScrollView
  13. 关于alter database datafile offline和alter database datafile offline drop 的区别
  14. window 命令大全
  15. 【linux】——cscope
  16. 内核poll机制
  17. https://www.cnblogs.com/beileixinqing/p/7724779.html vue-cli生成的项目配置开发和生产环境不同的接口 vue-cli生成的项目,vue项目配置了不同开发环境的接口地址,axios.defaults.baseURL如何引用这个地址,这是在我发布项目的时候考虑的,于是想到了
  18. Ajax 知识
  19. java有关构造器的面试题详解
  20. Cracking The Coding Interview4.5

热门文章

  1. vs问题解决:an operation is not legal in the current state
  2. linux基础练习题(2)
  3. VUE失去焦点提交修改值
  4. Github版本管理以及git使用
  5. weixinShare.js / 极简微信分享插件
  6. (Access denied for user &#39;root&#39;@&#39;slaver1&#39; (using password: YES))
  7. sublime3 破解
  8. python全栈开发day61-django简单的出版社网站展示,添加,删除,编辑(单表的增删改查)
  9. ionic2集成sdk后,连接超时的问题
  10. flink的集群的HA高可用