December 2013
Intermediate to advanced
384 pages
9h 54m
English
var week = ["sun", "Mon", "Tue", "Wed", "thur", "Fri", "sat"]; var weekdays = week.slice(1,6);
You can carve arrays the same way you can strings by using the .splice(start, end) method and specifying the starting index and the ending index. The items in the array beginning with the start index until the item just before the end index are returned in a new array object. All indexes are zero based.
Read now
Unlock full access