Permalink
Cannot retrieve contributors at this time
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
30 lines (29 sloc)
569 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Checks if `value` is less than `other`. | |
* | |
* @since 3.9.0 | |
* @category Lang | |
* @param {*} value The value to compare. | |
* @param {*} other The other value to compare. | |
* @returns {boolean} Returns `true` if `value` is less than `other`, | |
* else `false`. | |
* @see gt, gte, lte | |
* @example | |
* | |
* lt(1, 3) | |
* // => true | |
* | |
* lt(3, 3) | |
* // => false | |
* | |
* lt(3, 1) | |
* // => false | |
*/ | |
function lt(value, other) { | |
if (!(typeof value === 'string' && typeof other === 'string')) { | |
value = +value | |
other = +other | |
} | |
return value < other | |
} | |
export default lt |