Skip to content

Conversation

@serhii-baksheiev
Copy link
Contributor

No description provided.


console.log('Категория:', key);

for(let i = 0; i < category[key].length; i++){
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you have to define category[key] as a variable, that variable used widely and what does it mean not really clear.

For example, take a look on line 51, what does category[key][i] refer to ? what abstraction inside?


function fizzBuzz(num) {
let someRes;
if(num % 3 == 0 && num % 5 == 0){
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There was approach for FizzBuzz in class I guess you can apply it here

function newArr(arr){
let newArray = [];
for(let i = 0; i < arr.length; i++){
newArray.push( typeof arr[i]);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

arr[i] - probably better to give some name to that construction

function solution(arr) {
for (let key in arr) {
let arrKey = arr[key];
if (Number.isNaN(arrKey.age)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isNaN enough, no need refer to "Number"


function solution(arr) {
for (let key in arr) {
let arrKey = arr[key];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

arr[key] - is element, not an a arrKey :)



function solution(arr) {
for (let key in arr) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's better to use for loop instead of for-in.

for-in much slower than for loop

function unknownAge(arr) {
let newArr = [];
for (let key in arr) {
let arrKey = arr[key];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the arrKey name could be improved, it's just simple an a element for example

return newArr;
}
console.log(solution(array));

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please remove blank lines

@OlegLustenko OlegLustenko merged commit e92d431 into master Jun 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants