上一页 1 ··· 10 11 12 13 14 15 16 17 18 ··· 36 下一页
摘要: js单线程阻塞实例setTimeout(function () { while (true) { } }, 1000);setTimeout(function () { alert('end 2'); }, 2000);setTimeout(function () { alert('end 1'); 阅读全文
posted @ 2019-04-24 18:47 justSmile2 阅读(1113) 评论(0) 推荐(0)
摘要: setTimeout 与 setInterval 实现回调本质上区别:setTimeout(function(){ /* Some long block of code ... */ setTimout(arguments.callee,10);},10);setInterval(function( 阅读全文
posted @ 2019-04-24 18:45 justSmile2 阅读(108) 评论(0) 推荐(0)
该文被密码保护。 阅读全文
posted @ 2019-04-24 18:38 justSmile2 阅读(5) 评论(0) 推荐(0)
摘要: 1. this 指向 结合箭头函数的this分析 函数执行方式 this指向1.直接圆括号 window2.对象调用 对象3.事件触发 触发对象4.定时器运行 window (常常定义变量存储this以达到this指向特定对象)5.作为数组对象的某个元素 该数组对象 调用一个函数将暂停当前函数的执行 阅读全文
posted @ 2019-04-24 18:28 justSmile2 阅读(510) 评论(0) 推荐(0)
该文被密码保护。 阅读全文
posted @ 2019-04-24 16:51 justSmile2 阅读(6) 评论(0) 推荐(0)
摘要: indexOf 返回数值类型 ( 索引、-1 ) includes 返回布尔类型 ( true 、false ),且能区分出 NaN undefined ( 如新建空数组 ) 测试代码 var arr=[1,2,3,NaN] arr.indexOf(3) // 2 arr.indexOf(NaN) 阅读全文
posted @ 2019-04-24 15:24 justSmile2 阅读(205) 评论(0) 推荐(0)
摘要: Array.from的设计初衷是快速便捷的基于其他对象创建新数组,准确来说就是从一个类似数组的可迭代对象( Object、Array、String,Set,Map,arguments等 )创建一个新的数组实例,说人话就是,只要一个对象有迭代器,Array.from就能把它变成一个数组 Array.f 阅读全文
posted @ 2019-04-24 14:15 justSmile2 阅读(1001) 评论(0) 推荐(0)
摘要: 相关知识点: 构造函数、原型对象、实例对象 <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale= 阅读全文
posted @ 2019-04-24 13:54 justSmile2 阅读(216) 评论(0) 推荐(0)
该文被密码保护。 阅读全文
posted @ 2019-04-19 19:28 justSmile2 阅读(12) 评论(0) 推荐(0)
摘要: 1.demo <!DOCTYPE html> <html lang="zh-CN"> <head> <meta charset="utf-8"> <title>demo</title> <link rel="stylesheet" href="http://cdn.dowebok.com/98/cs 阅读全文
posted @ 2019-04-19 19:21 justSmile2 阅读(136) 评论(0) 推荐(0)
上一页 1 ··· 10 11 12 13 14 15 16 17 18 ··· 36 下一页