1. push - Adds an element to the end of an array.

    fruits = ["apple", "banana"]
    fruits.push("orange")
    # Output: ["apple", "banana", "orange"]    

2. pop - Removes the last element from an array and returns it.

    fruits = ["apple", "banana", "orange"]
    fruits.pop
    # Output: "orange"
    # fruits is now ["apple", "banana"]    

3. shift - Removes the first element from an array and returns it.

    fruits = ["apple", "banana", "orange"]
    fruits.shift
    # Output: "apple"
    # fruits is now ["banana", "orange"]    

4. unshift - Adds an element to the beginning of an array.

    fruits = ["banana", "orange"]
    fruits.unshift("apple")
    # Output: ["apple", "banana", "orange"]    

5. join - Joins all elements of an array into a string, separated by a delimiter.

    fruits = ["apple", "banana", "orange"]
    fruits.join(", ")
    # Output: "apple, banana, orange"    

6. reverse - Returns a new array with the elements in reverse order.

    fruits = ["apple", "banana", "orange"]
    fruits.reverse
    # Output: ["orange", "banana", "apple"]
    # fruits is still ["apple", "banana", "orange"]    

7. sort - Returns a new array with the elements sorted in ascending order.

    fruits = ["banana", "orange", "apple"]
    fruits.sort
    # Output: ["apple", "banana", "orange"]
    # fruits is still ["banana", "orange", "apple"]    

8. include? - Returns true if the array contains the specified element, false otherwise.

    fruits = ["apple", "banana", "orange"]
    fruits.include?("banana")
    # Output: true    

9. delete - Removes all elements that match the specified value from the array.

    fruits = ["apple", "banana", "orange", "banana"]
    fruits.delete("banana")
    # Output: "banana"
    # fruits is now ["apple", "orange"]    

10. uniq - Returns a new array with all duplicate elements removed.

    fruits = ["apple", "banana", "orange", "banana"]
    fruits.uniq
    # Output: ["apple", "banana", "orange"]
    # fruits is still ["apple", "banana", "orange", "banana"]    

11. slice - Returns a new array with the elements from the starting index to the ending index.

    fruits = ["apple", "banana", "orange"]
    fruits.slice(1, 2)
    # Output: ["banana", "orange"]
    # fruits is still ["apple", "banana", "orange"]    

12. compact - Returns a new array with all nil elements removed.

    fruits = ["apple", nil, "banana", nil, "orange"]
    fruits.compact
    # Output: ["apple", "banana", "orange"]
    # fruits is still ["apple", nil, "banana", nil, "orange"]    

13. flatten - Returns a new array with all nested arrays flattened into a single array.

    fruits = ["apple", ["banana", "orange"], "grape"]
    fruits.flatten
    # Output: ["apple", "banana", "orange", "grape"]
    # fruits is still ["apple", ["banana", "orange"], "grape"]    

14. map - Returns a new array with the result of applying the block to each element in the array.

    numbers = [1, 2, 3]
    numbers.map { |n| n * 2 }
    # Output: [2, 4, 6]
    # numbers is still [1, 2, 3]    

15. select - Returns a new array with all elements that satisfy the condition in the block.

    numbers = [1, 2, 3, 4, 5]
    numbers.select { |n| n % 2 == 0 }
    # Output: [2, 4]
    # numbers is still [1, 2, 3, 4, 5]    

16. reject - Returns a new array with all elements that do not satisfy the condition in the block.

    numbers = [1, 2, 3, 4, 5]
    numbers.reject { |n| n % 2 == 0 }
    # Output: [1, 3, 5]
    # numbers is still [1, 2, 3, 4, 5]    

17. count - Returns the number of elements in the array that satisfy the condition in the block, or the total number of elements if no block is given.

    numbers = [1, 2, 3, 4, 5]
    numbers.count { |n| n % 2 == 0 }
    # Output: 2    

18. max - Returns the maximum element in the array, according to the natural order.

    numbers = [1, 2, 3, 4, 5]
    numbers.max
    # Output: 5    

19. min - Returns the minimum element in the array, according to the natural order.

    numbers = [1, 2, 3, 4, 5]
    numbers.min
    # Output: 1    

20. each - Iterates over each element in the array, executing the block for each element.

    numbers = [1, 2, 3]
    numbers.each { |n| puts n }
    # Output: 1
    #         2
    #         3
    # numbers is still [1, 2, 3]    

21. reduce (or inject) - Combines all elements of the array by applying the block to the first two elements, then to the result and the next element, and so on. Returns the final result.

    numbers = [1, 2, 3, 4, 5]
    numbers.reduce { |sum, n| sum + n }
    # Output: 15
    # equivalent to numbers.inject { |sum, n| sum + n }    

22. any? - Returns true if at least one element in the array satisfies the condition in the block, false otherwise.

    numbers = [1, 2, 3, 4, 5]
    numbers.any? { |n| n % 2 == 0 }
    # Output: true    

23. all? - Returns true if all elements in the array satisfy the condition in the block, false otherwise.

    numbers = [1, 2, 3, 4, 5]
    numbers.all? { |n| n % 2 == 0 }
    # Output: false    

24. none? - Returns true if none of the elements in the array satisfy the condition in the block, false otherwise.

    numbers = [1, 2, 3, 4, 5]
    numbers.none? { |n| n % 7 == 0 }
    # Output: true    

25. include? - Returns true if the array includes the specified element, false otherwise.

    fruits = ["apple", "banana", "orange"]
    fruits.include?("banana")
    # Output: true    

26. uniq - Returns a new array with all duplicate elements removed.

    fruits = ["apple", "banana", "orange", "banana", "orange"]
    fruits.uniq
    # Output: ["apple", "banana", "orange"]
    # fruits is still ["apple", "banana", "orange", "banana", "orange"]    

27. zip - Returns a new array by merging corresponding elements of the original array(s) into subarrays.

    fruits = ["apple", "banana", "orange"]
    colors = ["red", "yellow", "orange"]
    fruits.zip(colors)
    # Output: [["apple", "red"], ["banana", "yellow"], ["orange", "orange"]]    

28. sort - Returns a new array with the elements sorted in ascending order according to the natural order.

    fruits = ["apple", "banana", "orange"]
    fruits.sort
    # Output: ["apple", "banana", "orange"]
    # fruits is still ["apple", "banana", "orange"]    

29. reverse - Returns a new array with the elements in reverse order.

    fruits = ["apple", "banana", "orange"]
    fruits.reverse
    # Output: ["orange", "banana", "apple"]
    # fruits is still ["apple", "banana", "orange"]    

30. join - Returns a new string by concatenating all elements in the array with the specified separator.

    fruits = ["apple", "banana", "orange"]
    fruits.join(", ")
    # Output: "apple, banana, orange"
    # fruits is still ["apple", "banana", "orange"]    

31. take - Returns the first n elements of the array, or all elements if the array has less than n elements.

    numbers = [1, 2, 3, 4, 5]
    numbers.take(3)
    # Output: [1, 2, 3]    

32. take_while - Returns the longest prefix of the array for which the block returns true.

    numbers = [1, 2, 3, 4, 5]
    numbers.take_while { |n| n < 4 }
    # Output: [1, 2, 3]    

33. drop - Returns the remaining elements of the array after the first n elements, or an empty array if the array has less than n elements.

    numbers = [1, 2, 3, 4, 5]
    numbers.drop(3)
    # Output: [4, 5]    

34. drop_while - Returns the remaining elements of the array after the longest prefix for which the block returns true.

    numbers = [1, 2, 3, 4, 5]
    numbers.drop_while { |n| n < 4 }
    # Output: [4, 5]    

35. cycle - Calls the block for each element of the array n times (default is infinite), or returns an Enumerator if no block is given.

    fruits = ["apple", "banana", "orange"]
    fruits.cycle(2) { |fruit| puts fruit }
    # Output:
    # apple
    # banana
    # orange
    # apple
    # banana
    # orange    

36. permutation - Returns a new array of arrays, each containing all possible permutations of the elements of the original array.

    numbers = [1, 2, 3]
    numbers.permutation.to_a
    # Output: [[1, 2, 3], [1, 3, 2], [2, 1, 3], [2, 3, 1], [3, 1, 2], [3, 2, 1]]    

37. combination - Returns a new array of arrays, each containing all possible combinations of n elements from the original array.

    numbers = [1, 2, 3]
    numbers.combination(2).to_a
    # Output: [[1, 2], [1, 3], [2, 3]]    

38. transpose - Returns a new array with the rows and columns of the original array transposed.

    matrix = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]
    matrix.transpose
    # Output: [[1, 4, 7], [2, 5, 8], [3, 6, 9]]    

39. slice_before - Returns an Enumerator that groups adjacent elements of the array according to the block.

    numbers = [1, 2, 3, 4, 5]
    numbers.slice_before { |n| n.even? }.to_a
    # Output: [[1], [2, 3], [4, 5]]    

40. bsearch - Returns the first element of the sorted array that satisfies the condition in the block, or nil if no such element is found.

    numbers = [1, 2, 3, 4, 5]
    numbers.bsearch { |n| n >= 3 }
    # Output: 3    

41. bsearch_index - Returns the index of the first element of the sorted array that satisfies the condition in the block, or nil if no such element is found.

    numbers = [1, 2, 3, 4, 5]
    numbers.bsearch_index { |n| n >= 3 }
    # Output: 2    

42. repeated_permutation - Returns a new array of arrays, each containing all possible permutations of the elements of the original array, allowing for duplicates.

    numbers = [1, 2, 3]
    numbers.repeated_permutation(2).to_a
    # Output: [[1, 1], [1, 2], [1, 3], [2, 1], [2, 2], [2, 3], [3, 1], [3, 2], [3, 3]]    

43. repeated_combination - Returns a new array of arrays, each containing all possible combinations of n elements from the original array, allowing for duplicates.

    numbers = [1, 2, 3]
    numbers.repeated_combination(2).to_a
    # Output: [[1, 1], [1, 2], [1, 3], [2, 2], [2, 3], [3, 3]]    

44. minmax - Returns a two-element array containing the minimum and maximum elements of the array, respectively.

    numbers = [1, 2, 3, 4, 5]
    numbers.minmax
    # Output: [1, 5]    

45. minmax_by - Returns a two-element array containing the minimum and maximum elements of the array, respectively, as determined by the block

    words = ["apple", "banana", "orange", "pear"]
    words.minmax_by { |word| word.length }
    # Output: ["pear", "banana"]    

46. grep_v - Returns a new array containing all elements of the original array that do not match the pattern given by the argument.

    words = ["apple", "banana", "orange", "pear"]
    words.grep_v(/a/)
    # Output: ["pear"]    

47. sum - Returns the sum of all elements of the array.

    numbers = [1, 2, 3, 4, 5]
    numbers.sum
    # Output: 15    

48. product - Returns a new array of arrays, each containing all possible combinations of elements from the original array and the given arrays.

    numbers = [1, 2, 3]
    letters = ["a", "b", "c"]
    numbers.product(letters)
    # Output: [[1, "a"], [1, "b"], [1, "c"], [2, "a"], [2, "b"], [2, "c"], [3, "a"], [3, "b"], [3, "c"]]    

49. zip - Returns a new array of arrays, each containing corresponding elements of the original array and the given arrays.

    numbers = [1, 2, 3]
    letters = ["a", "b", "c"]
    numbers.zip(letters)
    # Output: [[1, "a"], [2, "b"], [3, "c"]]    

50. sort_by - Returns a new array sorted by the values returned by the block.

    words = ["apple", "banana", "orange", "pear"]
    words.sort