omit
优质
小牛编辑
138浏览
2023-12-01
Creates an ObjectLikeSequence consisting of the key/value pairs from this sequence excluding those with the specified keys. Non-string keys are effectively ignored.
Signature
ObjectLikeSequence.omit = function(properties) { /*...*/ }
ObjectLikeSequence.omit = function omit(properties) { return new OmitSequence(this, properties); }
Name | Type(s) | Description |
---|---|---|
properties | Array | An array of the properties to omit from this sequence. |
returns | ObjectLikeSequence | The new sequence. |
Examples
var players = { "who": "first", "what": "second", "i don't know": "third" }; Lazy(players).omit(["who", "what"]) // sequence: { "i don't know": "third" } // Example to show handling of non-string keys Lazy({1: 2, true: false}).omit([1, true]) // sequence: { "1": 2, "true": false }