摘要: pdd分类 开 霸王 开 阅读全文
posted @ 2024-04-24 17:30 SmileBlog 阅读(7) 评论(0) 推荐(0) 编辑
摘要: 对象.prototype.方法名=funciton(){} //共享内存 显示结果需要再prototype里面查看 对象.__proto__ 构造函数.prototype 模块化的不成文的规定 __开头的代表私密的 对象先就近寻找调用的方法如果没有则在构造函数的原型上寻找如果还有再报错 原型链 构造 阅读全文
posted @ 2022-09-11 00:31 SmileBlog 阅读(25) 评论(0) 推荐(0) 编辑
摘要: 1.首字母大写 function CreateObj(name){ //自动创建对象 this.name=name //使用this接受 //自动返回对象 2.不要写return返回 } 3.构造函数 尽量不要当成普通函数用 4.this指向 构造函数的this执行再new创建对象完成 指向的是返回 阅读全文
posted @ 2022-09-10 23:25 SmileBlog 阅读(21) 评论(0) 推荐(0) 编辑
摘要: webpake moudule//模块 //导出函数 未导出的不可访问 export{ 函数1, 函数2 } 导入需要<script type="module"></scrip>进行导入 <script type="module"> import {函数1,函数2} from '路径' </scri 阅读全文
posted @ 2022-09-09 21:17 SmileBlog 阅读(26) 评论(0) 推荐(0) 编辑
摘要: var a=[1,2,3] var b=[4,5,6] 展开数组 var a.concat(b) 常规方法连接 var c=[...a,...b] 展开运算符 把他拿出来展开放在这 复制 var a=[1,2,3] var b =a 浅赋值 var b =a.splice() 深赋值 var b = 阅读全文
posted @ 2022-09-09 14:30 SmileBlog 阅读(29) 评论(0) 推荐(0) 编辑
摘要: 正常 var arr=["111","222","3333"] let [x,y,z]=arr console.log(x,y,z) 对应赋值 var a=10 var b=20 var [b,a]=[a,b] 实现交换变量 多维数组也可以 但是需要结构相同 解构需要一一对应 var obj={ n 阅读全文
posted @ 2022-09-09 13:30 SmileBlog 阅读(12) 评论(0) 推荐(0) 编辑
摘要: 常规var test=function(){ console.log(111) } 箭头函数 var test1=()=>{ console.log(222 ) } 当有一个参数时参数时可以省略() var test= a =>{ console.log(111,a) } var test=a => 阅读全文
posted @ 2022-09-09 12:12 SmileBlog 阅读(15) 评论(0) 推荐(0) 编辑
摘要: var let const 区别 var与let consot 1.let consot必须先声明在访问 2.let consot变量不可重名 3.let consot块级作用域 在{}起作用 外面访问不了 区别let 与consot let变量 const 常量 复杂类型 中的堆不会变但是里面的其 阅读全文
posted @ 2022-09-09 11:41 SmileBlog 阅读(15) 评论(0) 推荐(0) 编辑
摘要: call apply bind call 执行函数,并改变this为执行函数的第一个参数 后面的参数作为函数的参数 apply 执行函数,并改变this执行函数的第一个参数为对象 只接收一个数组 数组里面放函数的参数 bind 改变this为执行函数的第一个参数 后面的参数作为函数的参数 不会自动执 阅读全文
posted @ 2022-09-09 11:08 SmileBlog 阅读(11) 评论(0) 推荐(0) 编辑
摘要: 获取节点: +包括两种 1. 获取元素节点 1-1. 非常规标签 => html => body => head 1-2. 常规标签 => getElementById() => getElementsByClassName() => getElementsByTgaName() => getEle 阅读全文
posted @ 2022-09-08 21:32 SmileBlog 阅读(156) 评论(0) 推荐(0) 编辑
点击右上角即可分享
微信分享提示