jdkwky
jdkwky
``` function getMinIndex(list){ const result = [Infinity, -1]; for(let i = 0 , len = list.length ; i < len ; i++){ const temp = list[i] if(temp > 0 &&...
```javascript function formatIndexof(str, target, index) { let begin = index || 0; let end = str.length || 0; const tLen = target.length if (begin > end) { return -1; }...
> > ```js > > function formatIndexof(str, target, index) { > > let begin = index; > > let end = str.length - 1 || 0; > > if (begin...
首屏时间 fiddler抓包计算时间总和
```javascript function parse(str){ const list = str.split(/(\[|\])/).filter(val =>val); let result = null; let temp = null; for(let i = 0, len = list.length; i< len; i++){ const value = list[i];...
`const str = ['红', '蓝', '蓝', '黄', '红', '黄', '蓝', '红', '红', '黄', '红']; function rank(list) { const map = { '黄': 0, '红': 1, '蓝': 2 } return list.sort((val,...
class Node { constructor(value, next) { this.value = value; this.next = next; } } class LinkList { constructor(value) { const node = new Node(value, null); this.linkList = node; this.currentNode =...
```javascript function findIndex(list, target){ let start = 0, end = list.length -1; let index = -1; while(start !=end && start < end){ let mid = start + Math.floor((end - start...