Skip to content

Instantly share code, notes, and snippets.

@diasraphael
Created July 20, 2021 20:47
Show Gist options
  • Save diasraphael/5c1795c5d76087923292e76800635c0a to your computer and use it in GitHub Desktop.
Save diasraphael/5c1795c5d76087923292e76800635c0a to your computer and use it in GitHub Desktop.
function openOrSenior(data) {
const newData = data.map((item) => {
if (item[0] >= 55 && item[1] > 7) {
return 'Senior'
} else {
return 'Open'
}
});
return newData;
}
openOrSenior([
[18, 20],
[45, 2],
[61, 12],
[37, 6],
[21, 21],
[78, 9],
]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment