Tag Archives: Ruby Array-class

Array#push() : push() is a Array class method which appends the given object(s) on to the end of this array. Syntax: Array.push() Parameter: Array Return:… Read More
Array#product() : product() is a Array class method which returns an array of all combinations of elements from all arrays. Syntax: Array.product() Parameter: Array Return:… Read More
Array#pop() : pop() is a Array class method which checks removes the last element from the array and returns it. Syntax: Array.pop() Parameter: Array Return:… Read More
Array#permutation() : permutation() is a Array class method which returns all permutations of length n of the elements of the array, then return the array… Read More
Array#pack() : pack() is a Array class method which returns the contents of arr into a binary sequence according to the directives in aTemplateString Syntax:… Read More
Array#select!() : select!() is a Array class method which returns the given block passing in successive elements from self, deleting elements for which the block… Read More
Array#select() : select() is a Array class method which returns a new array containing all elements of array for which the given block returns a… Read More
Array#sample() : sample() is a Array class method which returns a random element or n random elements from the array. Syntax: Array.sample() Parameter: Array Return:… Read More
Array#rotate!() : rotate!() is a Array class method which returns self rotated in place so that the element at count comes first, and returns self.… Read More
Array#rotate() : rotate() is a Array class method which returns a new array by rotating self so that the element at count is the first… Read More
Array#rindex() : rindex() is a Array class method which returns the index of the last object in the array. Syntax: Array.rindex() Parameter: Array Return: the… Read More
Array#reverse_each() : reverse_each() is a Array class method which traverses self in reverse order. Syntax: Array.reverse_each() Parameter: Array Return: traverses self in reverse order. Example… Read More
Array#reverse!() : reverse!() is a Array class method which returns reverses self in place Syntax: Array.reverse!() Parameter: Array Return: Reverses self in place Example #1… Read More
Array#reverse() : reverse() is a Array class method which returns a new array containing self’s elements in reverse order. Syntax: Array.reverse() Parameter: Array Return: a… Read More
Array#replace() : replace() is a Array class method which returns an array of all combinations of elements from all arrays. Syntax: Array.replace() Parameter: Array Return:… Read More