Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

arrays:slice example #28

Open
http91 opened this issue Jun 19, 2021 · 0 comments
Open

arrays:slice example #28

http91 opened this issue Jun 19, 2021 · 0 comments

Comments

@http91
Copy link

http91 commented Jun 19, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant