JSFiddle - React, Tailwind, and code Playground

by joshmoto

JavaScript

var oPriceBreak = {
  10: 0.5,
  20: 0.8,
  '1': 1.2,
};

var iMaxQty;
var iMaxUnit;

$.each(oPriceBreak, function(qty, unit) {

  // get the last qty and set key
  iMaxQty = ~~qty;
  iMaxUnit = parseFloat(unit);

});

console.log(iMaxQty);