for this test, it should works, but i don’t know what’s wrong
i don’t know why , but in webstorm it is working, but on course website no, i guess on website there is other return structure, and i should add this. somewhere, but i don’t know where.
It looks like your post is mostly code; please add some more details. thank you stack overflow, but i want to post my question
it(`Push method should work with many items
input: [1, 2, 3].push(72, 12, 41)`, () => {
const source = [1, 2, 3];
source.push2(72, 12, 41);
expect(source)
.toEqual([1, 2, 3, 72, 12, 41]);
});
source.push2 = function(...param){
const parameters = [...param];
for (const item of parameters) {
source[source.length] = item;
}
return source;
};
2
Answers
You mean something like below
this
Array.prototype
length