Promise console.log All In One】的更多相关文章

Promise console.log All In One 同步事件/异步事件 微任务/宏任务 js 事件循环原理 先执行 同步事件 在执行,异步事件的所有微任务队列,按照时间顺序 最后执行,异步事件里的宏任务队列,按照时间顺序 "use strict"; /** * * @author xgqfrms * @license MIT * @copyright xgqfrms * @created 2020-10-01 * @modified * * @description * @d…
今天学习promise的时候看到了console.dir这个方法,感到很好奇,查了以下感觉又长知识了 在Chrome中,控制台对象定义了两个似乎做同样事情的方法: console.log() console.dir() 在控制台中看,好像都是做了一个打印的功能,但实际上还是又区别的: 在Firefox中,这些函数的行为截然不同:log只打印一个toString表示,而dir打印出一个可导航的树. 在Chrome中,日志已打印出一棵树 – 大部分时间.但是,Chrome的日志仍然会对某些类的对象进…
vue-cli2.0中的方法 1.安装插件 npm install uglifyjs-webpack-plugin --save-dev 2.修改webpack.prod.conf.js配置文件 const UglifyJsPlugin = require('uglifyjs-webpack-plugin'); plugins: [ // http://vuejs.github.io/vue-loader/en/workflow/production.html new webpack.Defin…
const 创建一个只读的常量 let块级作用域 const let重复赋值都会报错 console.log('a',a) a console.log('a'+a) a2 逗号的值会有空格:用加号的值没有空格…
(点击上方的订阅号,可快速关注,关注有惊喜哦^_^) 前不久看到一道JS基础题目,做了一下竟然错了一半...在此分享一下: 先把题目放上来,大家可以自己测试一下再看答案哦^_^ ①console.log(1+"2"+"3"); ②console.log(1+ +“2”+"3"); ③console.log("A"-"B"+"3"): ④console.log("A"-…
f1.html代码 <iframe id="frame2" name="frame1" src="ww.html"></iframe> <script type="text/javascript"> function ss(){ console.log($('#frame1')) // 打印信息 $f = $(].contentDocument.documentElement.innerTe…
[1]alert() [1.1]有阻塞作用,不点击确定,后续代码无法继续执行 [1.2]alert()只能输出string,如果alert输出的是对象会自动调用toString()方法 e.g. alert([1,2,3]);//'1,2,3' [1.3]alert不支持多个参数的写法,只能输出第一个值 e.g. alert(1,2,3);//1 [2]console.log() [2.1]在打印台输出 [2.2]可以打印任何类型的数据 e.g. console.log([1,2,3]);//[…
console.log((function f(n){) ? n * f(n-) : n)})()); 5被传入到函数,函数内部三元计算,5 > 1成立,运算结果是5*f(4),二次运算,5*4*f(3),依次类推,最终是5*4*3*2,最终返回结果是120. 如图:…
  JS高级群的日常!写一个从10到0的倒计时,用console.log打印,不可以用 setInterval!本来说好的研究avalonJS最后演变成了看着大神在那边互相比拼实力..   小森执行一个函数  没有全局变量 写一个从10到0的倒计时   用console.log打印  不可以用 setInterval   小白..额,可以多次调用setTimeout()吗     某个被打败的神Function fn(a){console.log(a--);if(a>=0)   Settimeo…
Difference console.log prints the element in an HTML-like tree console.dir prints the element in a JSON-like tree Example Specifically, console.log gives special treatment to DOM elements, whereas console.dir does not. This is often useful when tryin…