Guo Lizhi

Results 2 comments of Guo Lizhi

主要思路:将version打断成字符串数组,再进行排序,主要耗时点在于排序上 ```js function sortVersion(versions = []) { // 先将versions按逗号打断 versions = versions.map(version => { return version.split('.') }) versions.sort((a, b) => { const lenA = a.length const lenB = b.length for...

```js function repeat(func, times, wait) { if (times { if (count === times) { clearTimeout(timer) return } count++ func.apply(self, arguments) inner.apply(self, arguments) }, wait) } } ```