这些高阶函数好像不是原生的,里头用箭头函数写的话会报错
json = {} var kv = $('#test-form input,#test-form select').filter(f).map(m) function m(){ json[this.name]=this.value return } function f(){ if (this.name ==='gender'){ return this.checked } return true } json = JSON.stringify(json,null,' ')
Sign in to make a reply
alienation
这些高阶函数好像不是原生的,里头用箭头函数写的话会报错