--- nav-title: "observable-array How-To" title: "observable-array" description: "Examples for using observable-array" previous_url: /ApiReference/data/observable-array/HOW-TO --- # Observable Array module ### Create ObservableArray from array. ### Create ObservableArray from arguments. ### Create ObservableArray with specific length. ### Set ObservableArray length to new value. ### Get item at specified index using getItem(index) method. ### Set item at specified index using setItem(index, item) method. ### Set item at specified index using setItem(index, item) method and observe change event data. ### Use concat() method to combine ObservableArray with array. ### Use join() method to convert ObservableArray to comma separated string. ### Use join(separator) method to convert ObservableArray to string separated with specified separator. ### Use pop() method to remove the last element. ### Handle "change" event to know more info about the change after calling pop() method. ### Use push() method to add single element to the array. ### Handle "change" event to know more info about the change after calling push() method with single element. ### Use push() method to add multiple elements to the array. ### Handle "change" event to know more info about the change after calling push() method with multiple elements. ### Use push() method to add multiple elements from source array to the ObservableArray. ### Handle "change" event to know more info about the change after calling push() method with multiple elements from source array. ### Use reverse() method to reverse the elements order of the ObservableArray. ### Use shift() method to remove the first element of the array. ### Handle "change" event to know more info about the change after calling shift() method. ### Use slice() method to return array with all ObservableArray elements. ### Use slice(star, end) method to return section of the array. ### Use sort() method to sort the array. ### Use sort(compareFunction) method to sort the array with your own comparing logic. ### Use splice(start, deleteCount) method to delete elements in the array. ### Handle "change" event to know more info about the change after calling splice(start, deleteCount) method. ### Use splice(start, deleteCount, ...arguments) method to remove and insert elements in the array. ### Handle "change" event to know more info about the change after calling splice(start, deleteCount, ...arguments) method. ### Use unshift(item1, item2... itemN) method to insert elements from the start of the array. ### Handle "change" event to know more info about the change after calling unshift(item1, item2... itemN) method. ### Use indexOf(item) method to get the index of the desired item in the array. ### Use indexOf(item, fromIndex) method to get the index of the desired item in the array starting from specified index. ### Use lastIndexOf(item) method to get the last index of the desired item in the array. ### Use lastIndexOf(item, fromIndex) method to get the last index of the desired item in the array starting from specified index.