Home  >  Q&A  >  body text

javascript - What is this function used for?

Looking at the official website of underscore, it seems that the usage is different

PHP中文网PHP中文网2660 days ago801

reply all(1)I'll reply

  • 大家讲道理

    大家讲道理2017-06-16 09:21:23

    _.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:

    _.omit({foo:0,bar:null,baz:1},function(v){return !v})
    // {bar:1}

    reply
    0
  • Cancelreply