JS数组带有一个slice方法,可以获取数组的指定部分,下面的代码获取数组中的第二个和第三个元素
Click the button to extract the second and the third elements from the array. Try it
Click the button to extract the second and the third elements from the array.
上面的代码输出
Orange,Lemon
希望本文所述对大家的javascript程序设计有所帮助。