Skip to content

Instantly share code, notes, and snippets.

@kyptov
Created January 22, 2016 03:52
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 kyptov/fc1fa725040b7c9cb86c to your computer and use it in GitHub Desktop.
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.
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