-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
solution #2382
base: master
Are you sure you want to change the base?
solution #2382
Conversation
src/makeRobot.js
Outdated
@@ -39,6 +39,73 @@ | |||
*/ | |||
function makeRobot(name, wheels, version) { | |||
// write code here | |||
const Robot = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
capital first letter names are reserved for JS classes - please use plain object - robot
src/makeRobot.js
Outdated
name, | ||
wheels, | ||
version, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
properties are always first in each object, then goes functions (methods), please move those on top
src/makeRobot.js
Outdated
coords: { | ||
x: 0, | ||
y: 0, | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
properties are always first in each object, then goes functions (methods), please move those on top
src/makeRobot.js
Outdated
|
||
return this; | ||
}, | ||
evacuate: function evacuate() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
checklist point 2
src/makeRobot.js
Outdated
if (step < 0) { | ||
this.coords.x = this.coords.x; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can omit that - it does nothing
src/makeRobot.js
Outdated
}, | ||
goLeft(step = 1) { | ||
if (step < 0) { | ||
this.coords.x = this.coords.x; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can omit that - it does nothing
src/makeRobot.js
Outdated
}, | ||
goBack(step = 1) { | ||
if (step < 0) { | ||
this.coords.y = this.coords.y; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can omit that - it does nothing
src/makeRobot.js
Outdated
}, | ||
goForward(step = 1) { | ||
if (step < 0) { | ||
this.coords.y = this.coords.y; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can omit that - it does nothing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could add some spacing to improve readability, other than that great job!
No description provided.