I have an array of objects which looks like this:
var finishes = [
{label:'Raw Steel'},
{label:'Antique Pewter'},
{label:'Barn Red'},
{label:'Brushed Stainless Steel'},
{label:'Brushed Steel'},
{label:'Copper Patina'},
{label:'Dark Bronze'},
{label:'Distressed White'},
{label:'Flat Black'},
{label:'Green Patina'},
{label:'Oil Rubbed Bronze'},
{label:'White'},
{label:'Warehouse Bronze'},
{label:'Weathered Rust'},
];
var wheelFinishes = finishes;
As you can see I setup another array of objects which is going to have some different attributes then the "seed" array of objects.
So what I want to do is something like:
UPDATE wheelFinishes WHERE label="Barn Red" SET exclusion="Metal Values"
So the value of wheelFinishes would end up as:
var wheelFinishes = [
{label:'Raw Steel'},
{label:'Antique Pewter'},
{label:'Barn Red', exclusion:'Metal Values'},
{label:'Brushed Stainless Steel'},
{label:'Brushed Steel'},
{label:'Copper Patina'},
{label:'Dark Bronze'},
{label:'Distressed White'},
{label:'Flat Black'},
{label:'Green Patina'},
{label:'Oil Rubbed Bronze'},
{label:'White'},
{label:'Warehouse Bronze'},
{label:'Weathered Rust'},
];
I'm not sure on the actual syntax to update an array of objects in javascript.
I know underscorejs might have some functions that make this type of thing easier, so i'm open to a solution in underscorejs if that's even possible?