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
<!DOCTYPE HTML PUBLIC> | |
<html> | |
<head> | |
<title> Fun JS Exercises </title> | |
<!-- Load underscore.js | |
Feel free to use functions like _.each, _.map, _.filter, etc. | |
See docs here: http://underscorejs.org/ | |
--> |
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
################################################################################ | |
# Exercise #0 | |
# - Implement findPeople | |
# - findPeople takes 1 arg: a list of dicts of the form {'firstName': '__', 'lastName': '__'} | |
# - An element of DATA "matches" an element of the input list if it matches both firstName and lastName | |
# - findPeople should return a list of the same length as the input, with "matches" corresponding to | |
# each element of the input (for examples, see tests below) | |
# - If no match is found in DATA for some element of the input, the corresponding spot in the output array should be None | |
# - If multiple matches are found in DATA for an element of the input, choose the match with the largest age |