Created
May 25, 2018 20:51
-
-
Save ilko725/8b1f0bc4c810717ca8e2becb4f2b0779 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
// 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