Skip to content
Snippets Groups Projects
Commit 1303dd90 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

point.toString method implemented

parent a3a70e07
No related branches found
No related tags found
2 merge requests!35712.0.1 into master,!350Resolve "Comments issues"
......@@ -22,4 +22,12 @@ function Point(x, y) {
}
}
/**
*
* @returns {string}
*/
Point.prototype.toString = function () {
return "[" + this.x + ", " + this.y + "]";
};
module.exports = Point;
......@@ -29,4 +29,10 @@ describe('Point', function () {
});
});
it("toString", function () {
var point = new Point(12, 3);
assert.ok(point.toString().indexOf("12")>=0);
assert.ok(point.toString().indexOf("3")>=0);
});
});
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment