Skip to content

Instantly share code, notes, and snippets.

@milushov
Last active December 16, 2015 23:09
Show Gist options
  • Save milushov/5512389 to your computer and use it in GitHub Desktop.
Save milushov/5512389 to your computer and use it in GitHub Desktop.
data = [
{"created_at":"2013-03-07T12:24:06Z","id":49,"name":"Бегичева, улица","region_id":3,"updated_at":"2013-03-07T12:24:06Z"},
{"created_at":"2013-03-07T12:24:06Z","id":359,"name":"Беговая аллея","region_id":8,"updated_at":"2013-03-07T12:24:06Z"},
{"created_at":"2013-03-07T12:24:06Z","id":360,"name":"Беговая улица","region_id":8,"updated_at":"2013-03-07T12:24:06Z"},
{"created_at":"2013-03-07T12:24:06Z","id":361,"name":"Беговой проезд","region_id":8,"updated_at":"2013-03-07T12:24:06Z"},
{"created_at":"2013-03-07T12:24:15Z","id":3886,"name":"Беговая улица","region_id":115,"updated_at":"2013-03-07T12:24:15Z"}
];
data.forEach(function(element) {
data.forEach(function(el) {
if( element.id !== el.id && element.name === el.name) {
element.conflict = true;
}
});
});
console.log(data);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment