Created
May 26, 2015 03:56
-
-
Save stiekel/bdc8767106e26260c81e to your computer and use it in GitHub Desktop.
细细领会一下这是个什么程序的代码
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 contact = [ | |
{ nickname: 'coco', mobile: '13151185930', gender: '女' }, | |
{ nickname: 'F**k', mobile: '18651941714', gender: '女' } | |
]; | |
var price = [ | |
{ mobile: '13151185930', price: 1024 }, | |
{ mobile: '18651941714', price: 1722 } | |
]; | |
contact.forEach(function(c){ | |
price.forEach(function(p){ | |
if(c.mobile === p.mobile) { | |
c.price = p.price; | |
} | |
}); | |
}); | |
console.log('contact: ', contact); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment