In the development tools of Opera and Google Chrome gives an error:

test2.html: 16 Uncaught ReferenceError: Robot is not defined at test2.html: 16

Here is the code:

<!doctype html> <html lang ="en"> <head> <meta charset ="utf-8"> <title>est timeCounter</title> <script> "use strict"; function SpaceRobot(name, year, owner, homePlanet) { this.name = name; this.year = year; this.owner = owner; this.homePlanet = homePlanet; } SpaceRobot.prototype = new Robot; SpaceRobot.prototype.speak = function() { alert(this.name + " says Sir, If I may venture an opinion..."); }; SpaceRobot.prototype.pilot = function() { alert(this.name + " says Thrusters? Are they important?"); }; var c3po = new SpaceRobot("C3PO", 1977, "Luke Skywalker", "Tatooine"); c3po.speak(); c3po.pilot(); console.log(c3po.name + " was made by " + c3po.maker); var simon = new SpaceRobot("Simon", 2009, "Carla Diana", "Earth"); simon.makeCoffee(); simon.blinkLights(); simon.speak(); </script> </head> <body> </body> </html> 

Closed due to the fact that off-topic by user207618, Cheg , br3t , sanmai , ilyaplot 3 Aug '17 at 9:13 .

It seems that this question does not correspond to the subject of the site. Those who voted to close it indicated the following reason:

  • "The question is caused by a problem that is no longer reproduced or typed . Although similar questions may be relevant on this site, solving this question is unlikely to help future visitors. You can usually avoid similar questions by writing and researching a minimum program to reproduce the problem before publishing the question. " - community spirit, cheg, br3t, sanmai, ilyaplot
If the question can be reformulated according to the rules set out in the certificate , edit it .

  • 2
    and what is not clear? you have no Robot anywhere. Not Announced - Alexey Shimansky

1 answer 1

in the text of the error lies the answer) in the html document in the line

 SpaceRobot.prototype = new Robot; 

Robot - unknown to the browser. Rather, not previously announced, m. Did you need to connect any house file? a la:

 <script src="какой-тоскрипт.js"></script>