Alex

Results 11 comments of Alex

function removeStrEndSpace (str) { // 去掉末尾的空字符串 return str.replace(/\s$/g, ''); // 去掉行首的空字符串 return str.replace(/^\s*/g, ''); // 去掉所有字符串 return str.replace(/\s/g, ''); }

is there any get around or solution for this error?

1. 第一种 ```js let b = 1 let c = 2 let tmp tmp = b b = c c = tmp ``` 2. 第二种 ```js let a = 1;...

var str = '大家好 阿斯蒂芬阿斯顿\n发生的发生'; str.replace(/\n|\t/g, '');

回调函数: 当一个操作是异步的时候,此时为了获取异步的返回值,通常使用回调函数来接收值 1. dom的事件监听 2. 定时器 3. 异步操作 这里说下异步操作: function asyncFn (fn) { setTimeout(() => { let val = 5 fn(val) }, 1000); } asyncFn(val => { console.log(val); }) 时隔一秒后打印5

这里说错了是先执行微任务再执行宏任务; 1. 进入任务队列后是先执行完所有的宏任务 2. 判断是否有可执行的微任务 3. 执行完微任务后再执行宏任务 ![捕获](https://user-images.githubusercontent.com/42147133/89870193-1043dd00-dbe8-11ea-964c-ef12aff95685.PNG)

// 类型检测偏函数 const toString = Object.prototype.toString; function isType (type) { return function(obj) { return toString.call(obj) === `[object ${type}]`; }; } const isArray = isType('Array'); const isObject = isType('Object'); const isString...

hi, bro maybe this project can help you [https://github.com/Alex-Li2018/neo4j-d3-graph](https://github.com/Alex-Li2018/neo4j-d3-graph)

> * 时间对象Date > * 字符串对象String > * 数学对象Math > * 数值对象Number > * 数组对象Array > * 函数对象Function > * 函数参数集合arguments > * 布尔对象Boolean > * 错误对象Error > * 基础对象Object...