Collection of convenience code snippets (helpers) that aims to make it a little easier to work with vanilla JS
vanillajs-helpers > “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