Making JavaScript “typeof” work

Marcos Gonçalves
NERDJACKING
Published in
Aug 17, 2020

How to get the true data type of an element

Making JavaScript “typeof” work: how to get the true data type

Say hello to #StraightToThePoint series

NERDJACKING #StraightToThePoint series: short stories with no chit-chat, just pure hands on code.

On every story you will find smart code snippets that can elevate your coding experience and save you time to focus on what’s important.

Formulas

Typescript

ES6

Usage

API

typeOf({}); // "object"

Real world scenario / Usage case

Playground demo

Got something on your mind? Let us know in the comments 💪

--

--

Marcos Gonçalves
NERDJACKING

Lead Engineer | Architect | Developer Advocate | 12+ years of experience. Also a lover of a good beer in his spare time.