4 ms·
This (from their example) // Create a class called Point Class("Point", { has: { x: { is: "rw", i
by alexk 18y ago
This (from their example)
// Create a class called Point
Class("Point", {
has: {
x: {
is: "rw",
init: 0
},
y: {
is: "rw",
init: 0
}
},
methods: {
clear: function () {
this.setX(0);
this.setY(0);
}
}
})
looks a little bit scary, compared to native
function Point(x,y)
{
this.x = x;
this.y = y;
}
Point.prototype.clear = function()
{
this.x = this.y = 0;
}
I will better wait for JS2