OOP
九月上
这个作者很懒,什么都没留下…
展开
-
this,call,apply
this 对象var name='Jack';function show(){ console.log(this.name); console.log(this);//window }window.show();call(thisArg, arg1, arg2, ...)(可多参)apply(thisArg, [argsArray])(只可传入两参,第...原创 2019-02-21 20:18:20 · 114 阅读 · 0 评论 -
prototype -----原型 json方式创建对象
prototype -----原型 (实例对象才有prototype)例:function Stu(){ this.name='jack'; this.age=20;}Stu.prototype.run=function(){ console.log('run....');};var stu=new Stu();var a1=stu.run();va...原创 2019-02-21 19:58:05 · 352 阅读 · 0 评论 -
OOP----面向对象编程
OOP----面向对象编程 class 类1.javascript没有class (ES5) javascript的面向对象是一种非正统的怪异的面向对象2.使用function来模拟对象3.对象: 一切皆对象 对象包含:方法 属性 属性: 特性 ...原创 2019-02-20 20:35:54 · 111 阅读 · 0 评论 -
web存储
1.web存储: cookie 早期 本地存储: localStorage 永久存储 除非手动删除 sessionStorage 临时存储 (当存储关闭时,清除,只在当前页面生效) 两个存储...原创 2019-02-22 21:37:36 · 118 阅读 · 0 评论