DEV Community

loading...

Discussion on: Is Value an Object

Collapse
wheatup profile image
Hao

Or abuse JSON.stringify

const isObject = val => JSON.stringify(val).startsWith('{');
Collapse
nombrekeff profile image
Keff Author

Nice! Haven't seen this approach before :)

Forem Open with the Forem app