How this is done does not affect execution in any way, and it's just a matter of readability.
If you have a preference for announcing, then assign separately, no matter what.
If you do not use local scope variables such as var banana , as in classes, there is an effect on execution (but hardly).
example: this is probably easier to read (but this is a personal opinion) and requires less operation
var Foo = Class.reate(); Foo.prototype = { hoge : 1, fuga : 2, initialize : function(){ } };
than that:
var Foo = Class.reate(); Foo.prototype = { hoge:null, fuga:null, initialize : function(){ this.hoge = 1; this.fuga = 2; } };
source share