![]() |
Hash#shift() is a Hash class method which removes a key-value pair from hash and then it returns these value as two-item array.
Example #1 :
Output : Hash a shift form : [:a, 455] Hash b shift form : [:e, 500] Hash c shift form : [:a, 100] Example #2 :
Output : Hash a shift form : ["a", 344] Hash b shift form : ["a", 100] Hash c shift form : ["e", 100] |
Reffered: https://www.geeksforgeeks.org
Ruby |
Related |
---|
![]() |
![]() |
![]() |
![]() |
![]() |
Type: | Geek |
Category: | Coding |
Sub Category: | Tutorial |
Uploaded by: | Admin |
Views: | 9 |