planetproto
Version:
A Workshop for understanding JavaScript prototypes
23 lines (16 loc) • 533 B
Markdown
Our own 'new'
------------
At this stage we know enough to do amazing things with JavaScript objects.
Challenge
---------
- Define an object called `Robot`
- Define a method called `new` in `Robot`
- When `Robot.new` is called it should return a new object with the prototype set to `Robot` e.g.:
```js
var robby = Robot.new();
// Robot should be the prototype of robby
```
Boilerplate
-----------
Follow the instructions in the boilerplate file created.
A file 070.js with the necessary boilerplate has been created for you.