Conversation
| <script src="src/main.js"></script> | ||
|
|
||
|
|
||
| <!-- <div class="test-block"> |
There was a problem hiding this comment.
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
|
|
||
| function solution(arr){ | ||
| let _temp = {} | ||
| arr.forEach( function(element, index) { |
There was a problem hiding this comment.
it's a nice place to use Array.prototype.reduce
|
|
||
| let res = []; | ||
|
|
||
| Object.keys(_temp).forEach(function(value){ |
There was a problem hiding this comment.
your solution looks similar to Sergey are you worked a pair-programming?
There was a problem hiding this comment.
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.
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.
I've deleted blank rows
| */ | ||
| let app = { | ||
| render(){ | ||
| let div = document.createElement('div'); |
There was a problem hiding this comment.
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.
I've made smaller render function.
Data and functions are splitted.
|
Changes was pushed |
No comments.