Get Real Type

Published by 0osh4d0wo0 in

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

Watch a quick demo on how Edabit works.