javascript
螺丝哥
这个作者很懒,什么都没留下…
展开
-
[].slice.call(arguments)的理解
先放结论:[].slice.call(arguments)能将具有length属性的对象转成数组。可能大家在看某些代码的时候会发现有这样的代码,[].slice.call(arguments),[].push.apply(),这代码是什么意思呢,我捉摸了1晚上,现在分别为大家解析一下[].slice.call(arguments)这段代码的意思是能够将具有length属性的arguments转换为数组下面先拆分一下[]数组,意思是创建一个空的数组对象 slice() :方法可从已有的.原创 2020-06-17 12:22:22 · 3488 阅读 · 1 评论 -
JS将GMT字符串转换成时间年-月-日-时-分-秒
function formdatas(date){ var tempValue = date.replace("T", " "); var dateBefore = tempValue.slice(0,10); var timeBefore = tempValue.slice(11,19); var dateArray = dateBefore.split("-...原创 2019-08-01 18:23:19 · 1319 阅读 · 1 评论