Skip to content

Instantly share code, notes, and snippets.

@al-the-x
Created June 22, 2015 17:04
Show Gist options
  • Save al-the-x/539382d762fcee1cdbed to your computer and use it in GitHub Desktop.
Save al-the-x/539382d762fcee1cdbed to your computer and use it in GitHub Desktop.
QUIZ: lodash.pick
function pick(object, field){
return /* FILL ME IN */
}
module.exports = pick;
var pick = require('./pick.js'),
chai = require('chai');
var product = {
title: 'My Title',
price: '1M USD'
};
chai.expect(pick(product, 'title'))
.to.equal('My Title');
chai.expect(pick(product, 'price'))
.to.equal('1M USD');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment