Files
lodash/gte.js
John-David Dalton 6cb3460fce Remove semicolons.
2017-02-05 22:22:04 -08:00

33 lines
657 B
JavaScript

import toNumber from './toNumber.js'
/**
* Checks if `value` is greater than or equal to `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 greater than or equal to
* `other`, else `false`.
* @see gt, lt, lte
* @example
*
* gte(3, 1)
* // => true
*
* gte(3, 3)
* // => true
*
* gte(1, 3)
* // => false
*/
function gte(value, other) {
if (!(typeof value == 'string' && typeof other == 'string')) {
value = toNumber(value)
other = toNumber(other)
}
return value >= other
}
export default gte