0

プロトタイプを介してメソッドを追加しようとしていますが、エラーが発生します。何がうまくいかないのですか?

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.
4

0 に答える 0