-
-
Notifications
You must be signed in to change notification settings - Fork 184
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
A tiny js world #449
A tiny js world #449
Conversation
Hey! Congratulations on your PR! 😎😎😎 Let's do some self-checks to fix most common issues and to make some improvements to the code before reviewers put their hands on the code. Go through the requirements/most common mistakes listed/linked below and fix the code as appropriate. If you have any questions to requirements/common mistakes feel free asking them here or in Students' chat. When you genuinely believe you are done put a comment stating that you have completed self-checks and fixed code accordingly. Also, be aware, that if you would silently ignore this recommendation, a mentor can think that you are still working on fixes. And your PR will not be reviewed. 😒 A Tiny JS World -- (pre-OOP) exercise check listRelates to Object-Oriented JavaScript task. Check-list - definition of done
Universal recommendations:
Also take a note of the requirements above and follow them in all your future projects. By the way, you may proceed to the next task before this one is reviewed and merged. Sincerely yours, |
Hey! |
Hi! |
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.
@vl-shevchenko good job. Although requires improvements.
print('human; <strong>John</strong>; male; 2; 2; <em>Hello world!</em>; Rex, Tom, Jenny'); | ||
print('human; <strong>John</strong>; male; 2; 2; <em>Hello world!</em>; Rex, Tom, Jenny', 'div'); | ||
*/ | ||
let arr = [dog, cat, woman, man]; |
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.
From the checklist:
- Give variables and functions meaningful names. Avoid generic names like
item
,element
,key
,object
,array
or their variations. Exception: helper functions that are specifically and intentionally designed to be multipurpose.
*/ | ||
let arr = [dog, cat, woman, man]; | ||
arr.forEach(function ({ species, name, gender, legs, hands, saying }) { | ||
print(`${species}; <strong>${name}</strong>; ${gender}; ${legs}; ${hands}; <em>${saying}</em>`); |
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.
From the checklist:
- Code is DRY, which means that whenever you see a pattern in your code those should be eliminated as much as possible. Examples:
print(dog); print(cat); etc ...
should be refactored employingArray.forEach
as the least`${obj.legs}; ${obj.name}; etc...`
(yes, strings are also code) must be refactored employing appropriateArray
methods
@OleksiyRudenko, I corrected all comments |
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.
@vl-shevchenko great job!
BTW there is a way to keep extra content even with current |
A tiny js world
Demo |
Code base
The code is submitted in a dedicated feature branch.
Only code files are submitted.
Please, review.