Skip to content

Instantly share code, notes, and snippets.

@jrhii
Created October 9, 2016 22:28
Show Gist options
  • Save jrhii/92cf0be520f1bc25425c620c8649917c to your computer and use it in GitHub Desktop.
Save jrhii/92cf0be520f1bc25425c620c8649917c to your computer and use it in GitHub Desktop.
for (const colorArray of arrayOfColors) {
fs.writeFileSync(`colorArray_${colorArray[0].colorKey}.json`, JSON.stringify(colorArray, null, 2));
console.log(`owner ${colorArray[0].ownerID} is not null: ${colorArray[0].ownerId !== null}`);
if (colorArray.every(property => property.ownerId === colorArray[0].ownerId) && colorArray[0].ownerId !== null) {
for (const property of colorArray) {
property.isMonopoly = true;
}
} else {
for (const property of colorArray) {
property.isMonopoly = false;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment