const _initBreakpoints = function()

in lib/dd.breakpoints.es6.js [70:100]


const _initBreakpoints = function() {
	//sort the breakpoints into order of smallest to largest
	const sortedBreakpoints = _options.breakpoints.sort(function(a, b) {
		// only sort if the correct objects are present
		if (a.px < b.px) {
			return -1;
		}

		if (a.px > b.px) {
			return 1;
		}

		return 0;
	});

	// reset the breakpoints
	_minBreakpoints = {};
	_maxBreakpoints = {};

	// loop through sorted breakpoints to generate a quick lookup object using the name as a key
	for (let i = 0, len = sortedBreakpoints.length, last = len - 1; i < len; i += 1) {
		_minBreakpoints[sortedBreakpoints[i].name] = parseInt(sortedBreakpoints[i].px, 10);

		// skip the last item in the list as we assume there is no maximum for the last
		if (i < last) {
			// the max breakpoint of the current size is the next breakpoints
			// width minus 1px so there is no overlap between breakpoints
			_maxBreakpoints[sortedBreakpoints[i].name] = parseInt(sortedBreakpoints[i + 1].px - 1, 10);
		}
	}
};