Skip to content

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

exercise #2 #15

wants to merge 2 commits into from

Conversation

RV8V
Copy link

@RV8V RV8V commented Jan 3, 2020

I changed 2-array.test cause it said my line had a length of 96. Maximum allowed was 80 and my solution was short.

@@ -1,6 +1,6 @@
({
name: 'array',
length: [100, 200],
length: [80, 200],
Copy link
Member

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) =>
Copy link
Member

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);
Copy link
Member

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.

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.

2 participants