Skip to content

Instantly share code, notes, and snippets.

@wheresrhys
Created February 21, 2017 22:17
Show Gist options
  • Select an option

  • Save wheresrhys/c12bb321f0c2251981cfcfb3c7652796 to your computer and use it in GitHub Desktop.

Select an option

Save wheresrhys/c12bb321f0c2251981cfcfb3c7652796 to your computer and use it in GitHub Desktop.
(function(response) {
var output = [];
for (var i = 0; i < response.length; i++) {
if (response[i].type === 'PullRequestEvent') {
output.push(response[i])
}
}
return output;
})
(function(response) {
return response.filter(function(item) {
if (item.type === 'PullRequestEvent') {
return true
} else {
return false
}
})
})
(function(response) {
return response.filter(item => item.type === 'PullRequestEvent')
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment