Skip to content
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

add two more katas for [].fill() from MDN #56

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

Conversation

jizusun
Copy link
Contributor

@jizusun jizusun commented Nov 5, 2018

Copy link
Collaborator

@wolframkriesing wolframkriesing left a comment

Choose a reason for hiding this comment

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

Thanks a lot for the good ideas. I hope my amendments make sense. Would love to hear feedback from you.

katas/es6/language/array-api/fill.js Outdated Show resolved Hide resolved
assert.deepEqual(arr, [8,8,8]);
});

it('when gets passed an object, it will copy the reference and fill the array with references to that object.', function(){
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
it('when gets passed an object, it will copy the reference and fill the array with references to that object.', function(){
it('when passing an object, it will copy the reference and fill the array with references to that object', function(){

just a picky change :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually, I just copied the whole sentence from MDN 😅

When the fill method gets passed an object, it will copy the reference and fill the array with references to that object.

I'm not confident at all, but it feel like that it should be a passive voice.

arr[0].hi = "es6 katas";

assert.deepEqual(arr[2].hi, 'es6 katas');
});
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't understand the test description and how it is supposed to make the user arrive at the solution.
What I understand from the test description would be the following code (passing test).

const obj = {};
const arr = Array(1).fill(obj);
assert.equal(arr[0], obj);

wouldn't it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, you're right 😂

@jizusun
Copy link
Contributor Author

jizusun commented Nov 22, 2018

Hi sir, is it better now?

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