Newbie issue with intro docs on extend()


So offers up

Person = Ember.Object.extend({
  say(thing) {

I know a fair amount of .js but wasn’t sure what the syntax meant - like if I wanted a

 whisper(thing) { console.log(whisper); }

what would the syntax be?? I googled and got to which had a version that seemed to be a lot more recognizable:

 App.Person = Ember.Object.extend({
 say: function(thing) {

Feels like I can apply what I know about js maps, no problem? So unfortunately none of the examples on the first page cover "so you want to extend an object with multiple functions… what does that look like, and what would have been the best way for me to have learned it?


What you’re looking is a new way of declaring methods on an object in shorthand manner. The good thing is you can mix and match, you’re not forced into writing ES2015. So if you prefer the long way, continue to use it… it doesn’t matter to Ember or Ember CLI.


Aha, thanks. I’d only seen the new syntax in a conference. So Ember is taking care of any shimming or whatever for browsers to support both syntaxes? Or do you need to keep to the old syntax if you’re at all backwards compatible?


Yes, Ember CLI uses the babel transpiler during build. Read - or watch the video - under ES6 (and Beyond) in which overall gave me a good 10.000 ft “why Ember overview” (I’m fairly new to Ember too)

Regarding browser backwards compatibility IE9+ is supported going forward from the recent Ember 2.0. If you currently need IE8 you must step back to ember 1.13.X.