why put function definition outside the subclass definition

I saw some sample code of MoonWarriors

var Enemy = cc.Sprite.extend({

ctor:function (arg) {
this.*super;
>
this.HP = arg.HP;
this.moveType = arg.moveType;
this.scoreValue = arg.scoreValue;
this.attackMode = arg.attackMode;
this.enemyType = arg.type;
>
this.initWithSpriteFrameName;
this.schedule;
},
>*timeTick:0,
update:function (dt) {
var p = this.getPosition();
if ((p.x < 0 || p.x > 320) && (p.y < 0 || p.y > 480))
{
this.active = false;
}
this.*timeTick *= dt;
if {
this.*timeTick = 0;
if {
this.hurtColorLife—;
}
if {
this.setColor );
}
}
>
var p = this.getPosition;
if
{
this.active = false;
this.destroy;
}
>
},
destroy:function {
MW.SCORE
= this.scoreValue;
var a = Explosion.getOrCreateExplosion;
a.setPosition);
SparkEffect.getOrCreateSparkEffect);
if{
cc.AudioEngine.getInstance.playEffect;
}
this.setPosition;
this.stopAllActions;
this.unschedule;
},
shoot:function {
var p = this.getPosition;
var b = Bullet.getOrCreateBullet;
b.setPosition.height * 0.2);
},
hurt:function {
this.*hurtColorLife = 2;
this.HP—;
this.setColor( cc.c3b(255,0,0) );
},
collideRect:function§{
var a = this.getContentSize();
return cc.rect(p.x - a.width/2, p.y - a.height/4,a.width,a.height/2);
}
});
>
Enemy.getOrCreateEnemy = function(arg) {
for (var j = 0; j < MW.CONTAINER.ENEMIES.length; j++) {
selChild = MW.CONTAINER.ENEMIES[j];
>
if (selChild.active false && selChild.enemyType arg.type)
{
selChild.HP = arg.HP;
selChild.active = true;
selChild.moveType = arg.moveType;
selChild.scoreValue = arg.scoreValue;
selChild.attackMode = arg.attackMode;
selChild._hurtColorLife = 0;
selChild.setColor( cc.c3b(255,255,255) );
>
selChild.schedule(selChild.shoot, selChild.delayTime);
return selChild;
}
}
>
var addEnemy = new Enemy(arg);
g_sharedGameLayer.addEnemy(addEnemy, addEnemy.zOrder, MW.UNIT_TAG.ENEMY);
MW.CONTAINER.ENEMIES.push(addEnemy);
return addEnemy;
};

why put function ‘getOrCreateEnemy’ definition outside the ‘Enemy’ definition rather than do same thing as function ‘destroy’
Is there a particular reason for doing it?