← Back to challenges

Is it an Object?

JavaScriptHardconditionslogicobjectsvalidation

Instructions

Create a function to check whether the given parameter is an Object or not.

Examples

isObject(function add(x,y) {return x + y}) ➞ true

isObject(new RegExp('^[a-zA-Z0-9]+$', 'g')) ➞ true

isObject(null) ➞ false

isObject("") ➞ false

Notes

Inputs may be null, primitive wrapper types, dates.

javascript
Loading editor…
to run
Walks through the solution with reasoning and edge cases.
Next: Algebra Sequence — Boxes