Ruby 3.1 introduces pattern matching pin operator against expressionRuby 3.1 adds support for the expression and range when using the pattern matching pin operator.
Ruby 3.1 adds Enumerable#compact and Enumerator::Lazy#compactRuby 3.1 adds Enumerable#compact and Enumerator::Lazy#compact to return a copy of `self` with all `nil` elements removed.
Ruby 3.1 Enumerable#tally now accepts an optional hash to count occurrencesRuby 3.1 extends the functionality of the Enumerable#tally method introduced in Ruby 2.7. We can now pass another hash whose counts would be added to the resulting tally hash.
Ruby 3.1 adds Array#intersect? methodRuby Array#intersect? method will return true or false based on common elements present in the two arrays.
Ruby 3.1 evaluates multiple assignments from left to rightRuby changes the evaluation order for multiple assignments from left to right making it consistent with single assignment evaluation order.
Ruby 3.0 adds `Hash#except` and `ENV.except`Ruby 3.0 adds `Hash#except` to return a new hash that includes everything from the original hash except the given keys. `ENV` also gets support for `except`.
Ruby adds support for forwarding arguments to a method, along with the leading arguments... operator was limited to forwarding arguments. With Ruby 3.0, it can forward the arguments along with the leading arguments.
Ruby adds `Symbol#name` to return frozen string corresponding to the symbol nameRuby has added `Symbol#name`, which returns the name of the symbol if it is named. The returned string can not be modified.
Ruby adds experimental support for Rightward assignmentsPreviously ruby used to support only Rvalue to be assigned to Lvalue. Now, it adds support for Rightward assignment
Ruby introduces find pattern in pattern matchingFind pattern is introduced in pattern matching, which is useful in matching arrays.