Git Product home page Git Product logo

type_of's Introduction

typeOf

A utility for retrieving the type of a JS value

Install

npm i @ibnlanre/typeof

Import

// Browser
<script src="https://unpkg.com/@ibnlanre/typeof"></script>;

// ES6 Import
import typeOf from "@ibnlanre/typeof"

// NodeJS Require
const typeOf = require("@ibnlanre/typeof");

Usage

typeOf(async() => {}) // function
typeOf([1, "two", 3]) // array
typeOf(new Map()) // map

Reference

Value Type
42 number
new Number(3) number
"testing" string
new String("up") string
false boolean
new Boolean(true) boolean
/regEx/ regexp
new RegExp(/u/, "ig") regexp
null null
undefined undefined
NaN number
new Number("NaN") number
[1, "two"] array
new Array() array
{ a: "apple" } object
new Object() object
new Error() error
new TypeError() typeerror
new Map() map
new WeakMap() weakmap
new Set() set
new WeakSet() weakset
new Date() date
Object function
new Function() function
() => {} function
function*() {} function
async() => { await 0 } function
new (class Obj {})() obj
(function() { return arguments })() object
JSON object
Symbol("bar") symbol

type_of's People

Contributors

ibnlanre avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.