Skip to content

Commit

Permalink
Homeworks-2: task 1 was improved
Browse files Browse the repository at this point in the history
  • Loading branch information
dtr200 committed Jun 15, 2021
1 parent dd98a25 commit c3d6f31
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion homework-lecture-2/growing-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ function isGrows(list){
list = list.split(' ')
.map(num => Number(num));

if(!list.length || list.length === 1)
if(!list.length)
return 'NO';

let prev = list[0];
Expand Down
14 changes: 14 additions & 0 deletions homework-lecture-2/sequence-type.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
function getSequenceType(list){
if(!list.length)
return

let prev = list[0];

for(let i = 1; i < list.length; i++){
if(list[i] >= prev)
}
}

getSequenceType([
-530, -530, -530, -530, -530, -530
]);

0 comments on commit c3d6f31

Please sign in to comment.