← Back to challenges

Get Real Type

JavaScriptHardstringsvalidation

Instructions

Create a function that takes a value as an argument and returns the type of this value. You should get the real type of a value (JavaScript typeof doesn't return the real object type of values and you need to fix that).

Examples

realType(1) ➞ "number"

realType("a") ➞ "string"

realType(true) ➞ "boolean"

realType([]) ➞ "array"

realType(null) ➞ "null"

Notes

N/A

javascript
Loading editor…
to run
Walks through the solution with reasoning and edge cases.