INNER CODE UNIT · JavaScript

isNumber

nitaliano/react-native-mapbox-gl · javascript/utils/index.js:33

export function isNumber(num) {
  return typeof num === 'number' && !Number.isNaN(num);
}

export function isUndefined(obj) {
  return typeof obj === 'undefined';
}

export function isString(str) {
  return typeof str === 'string';
}

export function isBoolean(bool) {
  return typeof bool === 'boolean';
}

export function isPrimitive(value) {
  return isString(value) || isNumber(value) || isBoolean(value);

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…