Created
January 22, 2016 03:52
-
-
Save kyptov/fc1fa725040b7c9cb86c to your computer and use it in GitHub Desktop.
Mapping two array with native functions into objects, each object differs by parent array.
This file contains hidden or 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
var a = [1,2,3,4,5]; | |
var b = [11,12,13,14]; | |
var length = a.length; | |
var c = a.concat(b).map(function(value, index) { | |
return { | |
value: value, | |
isA: index >= length | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment