Why cant define the objects starts with App. using var?

App.PostsRoute=Ember.Route.extend({
   model:function(){
      return App.Comments;
   }
});

var App.Comments=[
{

},
{

}];

In the above code, model doesn’t recognize App.Comments. But if i remove var then its working. why is it so ?

Remove var before App.Comments. ( you’re not defining a new variable, you’re setting a property on App object )

http://emberjs.jsbin.com/AsinIcoM/2/edit