Created
June 22, 2015 17:04
-
-
Save al-the-x/539382d762fcee1cdbed to your computer and use it in GitHub Desktop.
QUIZ: lodash.pick
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function pick(object, field){ | |
return /* FILL ME IN */ | |
} | |
module.exports = pick; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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