Returns a boolean indicating which group an object's own and inherited property values belongs to.
Returns a boolean indicating which group an object's own and inherited property values belongs to.
Returns a boolean indicating which group an object's own and inherited property values belongs to.
Splits an object's own property values into two groups according to a predicate function.
input object
predicate function indicating which group an element in the input object belongs to
group results
function predicate( v ) {
return v[ 0 ] === 'b';
}
var obj = {
'a': 'beep',
'b': 'boop',
'c': 'foo',
'd': 'bar'
};
var out = bifurcateOwn( obj, predicate );
// e.g., returns [ [ 'beep', 'boop', 'bar' ], [ 'foo' ] ]
function predicate( v ) {
return v[ 0 ] === 'b';
}
var obj = {
'a': 'beep',
'b': 'boop',
'c': 'foo',
'd': 'bar'
};
var opts = {
'returns': 'keys'
};
var out = bifurcateOwn( obj, opts, predicate );
// e.g., returns [ [ 'a', 'b', 'd' ], [ 'c' ] ]
function predicate( v ) {
return v[ 0 ] === 'b';
}
var obj = {
'a': 'beep',
'b': 'boop',
'c': 'foo',
'd': 'bar'
};
var opts = {
'returns': '*'
};
var out = bifurcateOwn( obj, opts, predicate );
// e.g., returns [ [ [ 'a', 'beep' ], [ 'b', 'boop' ], [ 'd', 'bar' ] ], [ [ 'c', 'foo' ] ] ]
Splits an object's own property values into two groups according to a predicate function.
input object
function options
predicate function indicating which group an element in the input object belongs to
group results
function predicate( v ) {
return v[ 0 ] === 'b';
}
var obj = {
'a': 'beep',
'b': 'boop',
'c': 'foo',
'd': 'bar'
};
var out = bifurcateOwn( obj, predicate );
// e.g., returns [ [ 'beep', 'boop', 'bar' ], [ 'foo' ] ]
function predicate( v ) {
return v[ 0 ] === 'b';
}
var obj = {
'a': 'beep',
'b': 'boop',
'c': 'foo',
'd': 'bar'
};
var opts = {
'returns': 'keys'
};
var out = bifurcateOwn( obj, opts, predicate );
// e.g., returns [ [ 'a', 'b', 'd' ], [ 'c' ] ]
function predicate( v ) {
return v[ 0 ] === 'b';
}
var obj = {
'a': 'beep',
'b': 'boop',
'c': 'foo',
'd': 'bar'
};
var opts = {
'returns': '*'
};
var out = bifurcateOwn( obj, opts, predicate );
// e.g., returns [ [ [ 'a', 'beep' ], [ 'b', 'boop' ], [ 'd', 'bar' ] ], [ [ 'c', 'foo' ] ] ]
Returns a boolean indicating which group an object's own and inherited property values belongs to.
object value
object key
boolean indicating whether a property value should be placed in the first or second group