-
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
add task solution #2351
add task solution #2351
Conversation
src/makeRobot.js
Outdated
}, | ||
get info() { | ||
return `name: ${name}, chip version: ${version}, wheels: ${wheels}`; | ||
}, | ||
get location() { | ||
return `${this.name}: x=${this.coords.x}, 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.
add gaps here
src/makeRobot.js
Outdated
y: 0, | ||
}, | ||
get info() { | ||
return `name: ${name}, chip version: ${version}, wheels: ${wheels}`; |
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.
let's use 'this' here
If you will create a function to change these variables later - it will not work as expected without 'this'
src/makeRobot.js
Outdated
if (step < 1) { | ||
return this; | ||
} | ||
|
||
this.coords.x -= step; | ||
|
||
return this; |
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.
think on how you can refactor it to get rid of double 'return this' statement
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.
GJ,
Everything`s fine!
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.
Well done, but don`t forget about good code formating.
x: 0, | ||
y: 0, | ||
}, | ||
get info() { |
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.
get info() { | |
get info() { |
No description provided.