Skip to content

Instantly share code, notes, and snippets.

@kyptov
Created January 22, 2016 03:52
Mapping two array with native functions into objects, each object differs by parent array.
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