add two more katas for [].fill() from MDN#56
Conversation
wolframkriesing
left a comment
There was a problem hiding this comment.
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.
| 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.
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.
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.
Yes, you're right 😂
Co-Authored-By: jizusun <sunjizu+github@gmail.com>
|
Hi sir, is it better now? |
Uh oh!
There was an error while loading. Please reload this page.