-
Notifications
You must be signed in to change notification settings - Fork 58
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
base: master
Are you sure you want to change the base?
Conversation
jizusun
commented
Nov 5, 2018
•
edited
Loading
edited
- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/fill
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.
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
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(){ |
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.
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 :)
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.
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'); | ||
}); |
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.
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?
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.
Yes, you're right 😂
Co-Authored-By: jizusun <sunjizu+github@gmail.com>
Hi sir, is it better now? |