VaJoy Lan

Results 39 comments of VaJoy Lan

arguments是一个类数组的对象嘛,所以才输出的`[object Arguments]`,如果是 ``` function typeO(string){ console.log(Object.prototype.toString.call(string)) } typeO("带你飞"); ``` 就输出 `[object String]`了

我写的跟一楼的一模一样。。。汗,不过他比我简洁 ``` javascript function isEmpty(obj){ return Object.keys(obj).length>0?!1:!0 } ```

中规中矩毫无惊喜的我: ``` function int32ToIp(int32) { var r = "", binary = int32.toString(2); for(var i=0;i

还是@srw4115 写的好,小改下: ``` function flattenMap(a){ var result = {}, loop = function(obj,path){ var names = Object.keys(obj); names.forEach(function(name){ var p = path + name; if(Object.prototype.toString.call(obj[name]) === "[object Object]"){ loop(obj[name],p+"/") }else{ result[p]...

@XadillaX 大神能否来解下这道题呢?话说你好久没回everycode了

``` function csvColumns(csv, indices){ var result = "", rawArr = csv.split("\n"), l = rawArr.length-1; rawArr.forEach(function(item,index){ var temp, s=""; indices.forEach(function(i){ temp = item.substr(2*i,1); if(temp){ result+= s+temp;s=","} }) result+= (index==l?"":"\\n"); }) return...

-。- 好简单的都懒得回答了,话说大神@XadillaX 终于舍得回来了

@XadillaX 辛苦啦,有时间去做大保健,别累坏了 →。→

其实这题稍微改一下可以继续混一点变量提升的概念,23333 ``` javascript function a(x,y){ y = function(){x=2;}; return function(){ y(); console.log(x); var x = 3; //move it here }.apply(this,arguments); } a(); ```

@XadillaX 但是我修改后的那段代码运行后是undefined...