プロトタイプを介してメソッドを追加しようとしていますが、エラーが発生します。何がうまくいかないのですか?
function Graph() {
// Code
}
Graph.prototype.render = function() {
// Code
}
var test_graph = new Graph;
test_graph.render(); // Returns error that function Graph.render isn't defined.
プロトタイプを介してメソッドを追加しようとしていますが、エラーが発生します。何がうまくいかないのですか?
function Graph() {
// Code
}
Graph.prototype.render = function() {
// Code
}
var test_graph = new Graph;
test_graph.render(); // Returns error that function Graph.render isn't defined.