typeOf()
typeOf()
typeOf()
Gets the specific object type of any
value.
const typeOf = (value: any): string =>
Object.prototype.toString.call(value).slice(8, -1).toLowerCase();
Parameters
value: any
value: any
The value of any
type to obtain its object
class name.
Returns
The return value is the object
class name of the given value
.
Example usage
// Example usage.
import { typeOf } from '@angular-package/type';
Last updated
Was this helpful?