vanillajs-helpers

Collection of convenience code snippets (helpers) that aims to make it a little easier to work with vanilla JS

View the Project on GitHub Tokimon/vanillajs-helpers

vanillajs-helpers > “objectType”

External module: “objectType”

Index

Functions


Functions

objectType

objectType(obj: any): string

Defined in objectType.ts:13

Returns the objects type definition name (eg. [object String] => “string”)

objectType('string'); // -> 'string'
objectType(123); // -> 'number'
objectType({}); // -> 'object'

Parameters:

Param Type Description
obj any Object to get the type of

Returns: string