I have a master product list that has a logical object structure:
var myProducts = {
"productInfo":{
"productVariations":[{
"ID":XXXXXXX,
"Attributes":{
"edition":'professional',
"license":"perpetual"
}
},
{
"ID":XXXXXX,
"Attributes":{
"edition":'standard',
"license":"perpetual"
}
},
.
.
.
I am trying to compare this to a dynamically generated object array created by a product configurator application I have built. This list looks like this once generated:
var zcs_edition = [{ edition="standard", license="perpetual"}, { edition="professional", license="perpetual" }]
using $.inArray to compare the elements like below doesnt seem to be effective:
$.each(myProducts.productInfo.productVariations,function(i, val){
//console.log(this.productID);
//console.log(val.productAttributes );
//console.log($.inArray(val.productAttributes, zcs_edition ))
});
Am I doing something wrong here, I half expected this to work.