Looking at the official website of underscore, it seems that the usage is different
认证高级PHP讲师
_.omit()Receives attribute names or functions as rules to filter out attributes in objects.
_.omit()
The literal meaning here is to filter out the attributes whose property values are inverted to be true, that is: 0, undefined, null, etc.
For example:
_.omit({foo:0,bar:null,baz:1},function(v){return !v}) // {bar:1}
_.omit()
Receives attribute names or functions as rules to filter out attributes in objects.The literal meaning here is to filter out the attributes whose property values are inverted to be true, that is: 0, undefined, null, etc.
For example: