MCPcopy Create free account
hub / github.com/TheAlgorithms/JavaScript / isNumber

Function isNumber

Maths/Volume.js:115–121  ·  view source on GitHub ↗
(number, noName = 'number')

Source from the content-addressed store, hash-verified

113}
114
115const isNumber = (number, noName = 'number') => {
116 if (typeof number !== 'number') {
117 throw new TypeError('The ' + noName + ' should be Number type')
118 } else if (number < 0 || !Number.isFinite(number)) {
119 throw new Error('The ' + noName + ' only accepts positive values')
120 }
121}
122
123export {
124 volCuboid,

Callers 9

volCuboidFunction · 0.85
volCubeFunction · 0.85
volConeFunction · 0.85
volPyramidFunction · 0.85
volCylinderFunction · 0.85
volTriangularPrismFunction · 0.85
volPentagonalPrismFunction · 0.85
volSphereFunction · 0.85
volHemisphereFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected