Skip to content

arrays:slice example #28

@http91

Description

@http91

Hi!

var xs = [ 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i' ];
console.log(xs.slice(2, 3));
console.log(xs.slice(2));

There's an issue with the example provided above, it says it will print,

[ 'c', 'd', 'e' ]
[ 'c', 'd', 'e', 'f', 'g', 'h', 'i' ]

but it prints

['c'],
['c', 'd', 'e', 'f', 'g', 'h', 'i']

so the first part is wrong.

Thank you for the workshop.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions