-
-
Notifications
You must be signed in to change notification settings - Fork 112
exercise #2 #15
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
base: master
Are you sure you want to change the base?
exercise #2 #15
Conversation
@@ -1,6 +1,6 @@ | |||
({ | |||
name: 'array', | |||
length: [100, 200], | |||
length: [80, 200], |
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.
Don't change tests
@@ -1,5 +1,6 @@ | |||
'use strict'; | |||
|
|||
const array = () => null; | |||
const array = (a = [], f) => |
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.
Don't use arguments to declare local scope variables
@@ -1,5 +1,6 @@ | |||
'use strict'; | |||
|
|||
const array = () => null; | |||
const array = (a = [], f) => | |||
(f = i => a[i], f.push = s => a.push(s), f.pop = () => a.pop(), f); |
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.
Cryptic code. Rewrite as a block of code, for better reading. Because this function is not in function-programming style, it uses mixins and mutable arrays, so it is not good idea to write it in a functional-style.
I changed 2-array.test cause it said my line had a length of 96. Maximum allowed was 80 and my solution was short.