Skip to content

Instantly share code, notes, and snippets.

@ilko725
Created May 25, 2018 20:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ilko725/8b1f0bc4c810717ca8e2becb4f2b0779 to your computer and use it in GitHub Desktop.
Save ilko725/8b1f0bc4c810717ca8e2becb4f2b0779 to your computer and use it in GitHub Desktop.
// mosquid_variant
var numbers = [10, 12, 5, 7, 14, 16, 11, 4]
function evenOdd() {
if (!this.length)
return null
var resp = {
odd: [],
even: []
}
for (var n of this) {
if (n % 2)
resp.odd.push(n)
else
resp.even.push(n)
}
return resp
}
var r = evenOdd.call(arr)
console.log(r)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment