Create a gist now

Instantly share code, notes, and snippets.

@chuck0523 /slice.js
Last active Apr 15, 2017

What would you like to do?
let ary = [1, 2, 3, 4, 5]
// 第二引数は"未満"の終了位置
ary.slice(2, 3) // [3]
// 元の配列に変更はなし
console.log(ary) // [1, 2, 3, 4, 5]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment