![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
js
shuoxi666
这个作者很懒,什么都没留下…
展开
-
全面理解 JS的 event loop(事件循环机制)
目录JavaScript是单线程执行栈、任务队列同步任务、异步任务、宏任务、微任务setTimeout()、setInterval()Promiseprocess.nextTicksetImmediate优先级代码解析 先看段代码: console.log(1) setTimeout(function() { console.log(2) new Promise(function(resolve, reject) { console.log(原创 2020-08-20 12:08:51 · 330 阅读 · 0 评论 -
js实现别踩白块
文章目录html部分:css部分:javascript部分: html部分: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-sca...原创 2019-12-06 16:38:24 · 281 阅读 · 0 评论 -
js中 this问题
先看一张规则图 判断时间是函数执行的时候 总结规则: 1.如果使用了new语句,那么this就指向新创建的对象。 function Person(){ this.age = 20; this.sex = "man"; this.name = "xiaoq"; console.log(this); } var people ...原创 2019-12-01 20:17:41 · 117 阅读 · 0 评论 -
js typeof的所有返回值
typeof的所有返回值 1. " number " 2. " object " 3. " string " 4. " boolean " 5. " function " 6. " undefined " 一些特殊的返回值 表达式 返回值 typeof NaN " number " typeof undefined " undefined " typeof null "...原创 2019-12-01 11:49:21 · 189 阅读 · 0 评论 -
js中布尔值为false的六种情况
以下6个值转换为布尔值为false。 1. undefined 2. false 3. 0 4. “”(空字符串) 5. null 6. NaN 除了以上6个值,其余所有值转换为布尔值都为true。原创 2019-12-01 11:39:10 · 1852 阅读 · 0 评论 -
Object.create()方法
一:语法 Object.create(proto, [propertiesObject]) 该方法创建一个新对象,并指定该对象的原型对象 ------- proto 二:参数 proto : 必须。表示新建对象的原型对象,即该参数会被赋值到目标对象的原型上。该参数可以是null, 对象, 函数的prototype属性(创建无原型的对象时需传null , 否则会抛出TypeError异常)。...原创 2019-11-13 21:58:07 · 410 阅读 · 0 评论 -
js遍历对象
使用js遍历对象(递归) <html> <title>js遍历对象</title> <body> <script> var cla = { list: { person: { name: "shishuo...原创 2019-10-16 17:12:03 · 78 阅读 · 0 评论 -
js小知识点
一:typeof()可能返回的值 1.number 2.String 3.boolean 4.object 数组,对象,null的返回值都是object 5.function 6.undefined 二:区分对象和数组的三种方法 1.toString 2.constructor 3.instanceof ...原创 2019-05-22 08:35:03 · 62 阅读 · 0 评论