Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Which of the following statement is true about graphObj? 1. The variable graphObj has no methods, and only has access to the nodes and edges
Which of the following statement is true about graphObj?
1. The variable graphObj has no methods, and only has access to the nodes and edges arrays.
2. The variable graphObj can perform both the addNodes and addEdges methods.
3. The variable graphObj can only perform the addEdges method.
4. The variable graphObj can only perform the addEdges method.
Consider the following JavaScript code for creating a Graph object: function Graph() \{ this.nodes =; this. edges =; \} Graph.prototype.addNodes = function (n){ this. nodes.push(n); \}; Graph.prototype.addEdges = function(n)\{ this. edges.push(n); \}; let graph0bj = new Graph()Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started