Closed
Description
- Version: 14.2.0
- Platform: Linux portablejp 5.6.14 test: extend timeout for failure on cluster worker init test #10 SMP Sun May 24 09:52:23 CEST 2020 x86_64 Intel(R) Core(TM) i5-7600 CPU @ 3.50GHz GenuineIntel GNU/Linux
- Subsystem:
What steps will reproduce the bug?
in learyounode, excersise 2, working with rest operator:
let begin = 0;
let {,,...numbersl} = process.argv;
for(let i in numbersl) {
begin += Number(i);
};
console.log(begin);
gives an error "numbersl is not iterable".
when digging into the code:
let begin = 0;
let {ax,bx,...numbersl} = process.argv;
/*for(let i of numbersl) {
begin = (begin + Number(i));
}*/
console.log(numbersl);
the answer is:
node baby-steps.js 1 2 3
{
'0': '/usr/bin/node',
'1': '/tmp/baby-steps.js',
'2': '1',
'3': '2',
'4': '3'
}
...whereas you would expect the 0 and 1 to be removed from numbersl
How often does it reproduce? Is there a required condition?
tried several times, occurs every time
What is the expected behavior?
argument 0 and 1 are removed from numbersl
What do you see instead?
arguments are still included
Additional information
Metadata
Metadata
Assignees
Labels
No labels