qtdeclarative/tests/manual/v4/fun.2.js

15 lines
186 B
JavaScript
Raw Permalink Normal View History

2012-05-09 11:30:22 +00:00
function Point(x,y) {
this.x = 10
this.y = 20
}
2012-05-09 13:06:30 +00:00
Point.prototype = {
print: function() { print(this.x, this.y) }
}
2012-05-09 11:30:22 +00:00
var pt = new Point(10, 20)
print(pt.x, pt.y)
2012-05-09 13:06:30 +00:00
pt.print()
2012-05-09 11:30:22 +00:00