arguments对象。如果卡住,请记得使用Read-Search-Ask 。编写自己的代码。 destroyer([1, 2, 3, 1, 2, 3], 2, 3)应该返回[1, 1] 。'
testString: assert.deepEqual(destroyer([1, 2, 3, 1, 2, 3], 2, 3), [1, 1]);
- text: 'destroyer([1, 2, 3, 5, 1, 2, 3], 2, 3)应该返回[1, 5, 1] 。'
testString: assert.deepEqual(destroyer([1, 2, 3, 5, 1, 2, 3], 2, 3), [1, 5, 1]);
- text: 'destroyer([3, 5, 1, 2, 2], 2, 3, 5)应该返回[1] 。'
testString: assert.deepEqual(destroyer([3, 5, 1, 2, 2], 2, 3, 5), [1]);
- text: 'destroyer([2, 3, 2, 3], 2, 3)应该返回[] 。'
testString: assert.deepEqual(destroyer([2, 3, 2, 3], 2, 3), []);
- text: 'destroyer(["tree", "hamburger", 53], "tree", 53)应该返回["hamburger"] 。'
testString: assert.deepEqual(destroyer(["tree", "hamburger", 53], "tree", 53), ["hamburger"]);
- text: 'destroyer(["possum", "trollo", 12, "safari", "hotdog", 92, 65, "grandma", "bugati", "trojan", "yacht"], "yacht", "possum", "trollo", "safari", "hotdog", "grandma", "bugati", "trojan")应该返回[12,92,65] 。'
testString: assert.deepEqual(destroyer(["possum", "trollo", 12, "safari", "hotdog", 92, 65, "grandma", "bugati", "trojan", "yacht"], "yacht", "possum", "trollo", "safari", "hotdog", "grandma", "bugati", "trojan"), [12,92,65]);
```