Here is my code:
object = {'name' : String}
object = {'age' : Number}
typeof object.name // 'function'
typeof object.age // 'function'
Is it possible to check that object.name is a String and object.age is a Number?
Using typeof only gives me back ‘function’.
Rather than doing:
You should check for actual data type:
And here is how you can check their type:
Output: