Discuss / JavaScript / 我管这叫隔山打牛

我管这叫隔山打牛

Topic source

alienation

#1 Created at ... [Delete] [Delete and Lock User]

这些高阶函数好像不是原生的,里头用箭头函数写的话会报错

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,'  ')

  • 1

Reply