MCPcopy
hub / github.com/lodash/lodash / toInteger

Function toInteger

lodash.js:12495–12500  ·  lodash.js::toInteger

* Converts `value` to an integer. * * **Note:** This method is loosely based on * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger). * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to conve

(value)

Source from the content-addressed store, hash-verified

12493 * class="cm">// => 3
12494 */
12495 function toInteger(value) {
12496 var result = toFinite(value),
12497 remainder = result % 1;
12498
12499 return result === result ? (remainder ? result - remainder : result) : 0;
12500 }
12501
12502 /**
12503 * Converts `value` to an integer suitable for use as the length of an

Callers 15

baseFillFunction · 0.85
createRoundFunction · 0.85
createWrapFunction · 0.85
chunkFunction · 0.85
dropFunction · 0.85
dropRightFunction · 0.85
findIndexFunction · 0.85
findLastIndexFunction · 0.85
flattenDepthFunction · 0.85
indexOfFunction · 0.85
lastIndexOfFunction · 0.85
nthFunction · 0.85

Calls 1

toFiniteFunction · 0.85

Tested by

no test coverage detected