Hi I am looking a way to get the lowest value in my varients object.
so my object looks like this:
console.log(this.variants);
I can then create one object from the above:
var result = {};
$.each(this.variants, function (i, val) {
result += val.breaks.split('\n') ;
}); console.log(result);
which gives me:
25:0.20,249:0.20,250:0.16,499:0.16,500:0.12,1000:0.12,25:0.21,249:0.21,250:0.17,499:0.17,500:0.14,1000:0.14,25:0.29,249:0.29,250:0.24,499:0.24,500:0.18,1000:0.18,25:0.31,249:0.31,250:0.25,499:0.25,500:0.20,1000:0.20,25:0.34,249:0.34,250:0.28,499:0.28,500:0.21,1000:0.21,25:0.51,249:0.51,250:0.41,499:0.41,500:0.31,1000:0.31,20:0.92,259:0.92,260:0.74,519:0.74,520:0.56,1000:0.56,25:0.39,249:0.39,250:0.32,499:0.32,500:0.25,1000:0.25,25:0.52,249:0.52,250:0.42,499:0.42,500:0.32,1000:0.32,25:0.72,249:0.72,250:0.58,499:0.58,500:0.47,1000:0.47,
This lowest value should be
0.12 so I require
500:0.12.
Any help would be appreciated.
Thanks