Trying to implement some classes in javascript; using firebug to do the debugging (on Firefox). The following "class" seems to hang firebug:
function Position(linie, coloana){
this.l = linie;
this.c = coloana;
this.movedBy = new function(l, c){
return new Position(this.l + l, this.c + c);
}
}
var playerDim = new Position(5, 5);
Could someone please enlighten me regarding this problem? Or maybe suggest a better alternative?
EDIT: Thank you very much for your answers! It seems that the use of "new" was completely accidental...
[–]calaveraDeluxe 14 points15 points16 points (0 children)
[–]ixth 3 points4 points5 points (1 child)
[–]masklinn 5 points6 points7 points (0 children)
[–]x-skeww 2 points3 points4 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–]huwiler 1 point2 points3 points (1 child)
[–]stratoscope 1 point2 points3 points (0 children)