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
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#