0.0.1 • Published 10 years ago

sc-pick v0.0.1

Weekly downloads
1
License
MIT
Repository
-
Last release
10 years ago

TOC

pick(object:Object, keys:Array)

example.

var testObject = {
	name: "David",
	__privateProperty: "booya",
	country: "Australia"
};
var newObject = pick( testObject, [ "name", "country" ] );
Object.keys( newObject ).should.have.lengthOf( 2 );
newObject.should.have.a.property( "name", testObject.name );
newObject.should.have.a.property( "country", testObject.country );
newObject.should.not.have.a.property( "__privateProperty" );