Don't forget about Ember.typeOf()
Ember.TypeOf() returns a consistent type for the passed item across all browsers. It adds a bit more detail to the return value and can make checks on Ember.Object (classes and instances) It uses the duck-typing technique of toString(), which returns [object [Class]], and then matches via a regex.
Examples
Ember.typeOf() // => 'undefined'
Ember.typeOf('string') // => 'string'
Ember.typeOf({a: "b"}) // => 'object'
Ember.typeOf(undefined) // => 'undefined'Written by Ulises Ramirez-Roche
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Javascript
Authors
Did you know?
JavaScript on a page runs with the privileges of that origin. One altered library, tag manager, or snippet can read inputs, change what people see, and call your APIs as the user.
Security insights from Cside
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#