摘要:
push进入对象的key,如果要用变量形式,应该用[]括起来。不然key会被识别成字符串。 var pid = '1'; var pcheck = '23'; specPush.push({ [pid]: pcheck, }); 阅读全文
摘要:
var a = [{src:"websrv1"}, {dst:"websrv2"}, {dstport:"80"}]; var b = a.reduce( function(reduced,next){ Object.keys(next).forEach(function(key){reduced[ 阅读全文