-
Notifications
You must be signed in to change notification settings - Fork 0
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
Homework 14 #12
base: master
Are you sure you want to change the base?
Homework 14 #12
Conversation
<script src="src/main.js"></script> | ||
|
||
|
||
<!-- <div class="test-block"> |
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.
please do not commit commented code it makes it hard to understand if it a mistake or commented solution or what do you really mean.
Your homework should be clear without commented code
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.
Deleted
|
||
function solution(arr){ | ||
let _temp = {} | ||
arr.forEach( function(element, index) { |
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.
it's a nice place to use Array.prototype.reduce
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.
Done
|
||
let res = []; | ||
|
||
Object.keys(_temp).forEach(function(value){ |
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.
your solution looks similar to Sergey are you worked a pair-programming?
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.
Nope....
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.
Is solution wrong& what I must to do with your comment?
div.appendChild(head); | ||
|
||
let form = document.createElement('form'); | ||
|
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.
please remove blank line here.
In most scenarios or code-bases there few blank lines if some more complex logic begin or you divide declaring variables and app logic
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.
I've deleted blank rows
*/ | ||
let app = { | ||
render(){ | ||
let div = document.createElement('div'); |
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 have very huge "render" method which doing a lot of job.
That has roles:
- "the-storage - where you stored all you data"
- initializing elements
- creating elements
- connect elements
- some knowledge of content
It will be much better to make a smaller function which would have only 1 responsibility, and than connect such parts inside render
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.
I've made smaller render function.
Data and functions are splitted.
Changes was pushed |
No comments.