码飞_CC

Results 5 comments of 码飞_CC

```javascript function objToArr(obj) { const arr = new Array(12).fill(null) for(let key in obj) { arr[key - 1] = obj[key] } return arr } ``` 骚操作的确很多,但我觉得代码可读性和可维护性也很重要吧?假如obj的范围是100W,但它只有1个元素,我们还傻乎乎地去遍历数组的每个元素么。。。

> 有大佬能解答下next()调用的时机吗,这个运行流程我有点看不懂=。= 这个跟event-loop(事件循环)有关,感兴趣的可以来了解一下我这篇文章:[https://chen-cong.blog.csdn.net/article/details/97107219](https://chen-cong.blog.csdn.net/article/details/97107219)

> You can use the render "renderTag" prop and make the tag an editable tag. Can you give us an example of how to edit a tag?

I rewrite renderTag as follows, hope it helps ```javascript renderTag = (props) => { const { isTagFocus } = this.state const { tag, key, diasbled, onRemove, classNameRemove, getTagDisplayValue, ...other }...

> 难道就不能不用定时器吗 > > ```js > function sleep (time) { > var now = +Date.now() > while (+Date.now() - now return > } > console.time(1) > sleep(2000) > console.log(123) >...