JJ

Results 14 comments of JJ

```javascript function trimString(str, type) { let allRegex = { left: /^\s+/, right: /\s+$/, both: /(^\s+)|(\s+$)/g, all: /\s+/g }; if (type === "middle") { let cacheLeft = str.match(allRegex.left)[0]; let cacheRight =...

```javascript let a1 = ['A1', 'A2', 'B1', 'B2', 'C1', 'C2', 'D1', 'D2'] let a2 = ['A', 'B', 'C', 'D'].map((item) => { return item + 3 }) let a3 = [...a1,...

```javascript function strCount(str, target) { let count = 0; while (str.includes(target)) { str = str.replace(target, ""); count++; } return count; } function strCount(str, target) { return str.split(target).length - 1; }...

```javascript function stringToUpperLower(str) { return str.replace(/([a-z]*)([A-Z]*)/g, (all, $1, $2) => { return $1.toUpperCase() + $2.toLowerCase(); }) } console.log(stringToUpperLower('a0B1c2D3e4F5g')) ```

宏观任务队列 微观任务队列 的区别

我想问下这里 或 后面的object在什么情况下会发生 class2type[Object.prototype.toString.call(obj)] || 'object'

@mqyqingfeng 酷炫屌炸天

第三版 if (remaining wait) { 这里的remaining好像不会出现大于wait的情况吧 毕竟是基于wait去减的

@lindazhang102 这个是转时间戳的方法

const mergeSort = (arr) => arr.reduce((cacheArr, it) => [...cacheArr, ...it], []).sort((a, b) => a - b); const arr = [[1, 2, 3], [6], [7, 8, 9], [1, 12, 13], [4,...