VOOZH about

URL: https://www.geeksforgeeks.org/ruby/ruby-queue-function/

⇱ Ruby | Queue << function - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Ruby | Queue << function

Last Updated : 12 Jul, 2025
The <<() is an inbuilt function in Ruby inserts the element in the queue.
Syntax: q_name << element Parameters: The function takes the element to be inserted into the queue. Return Value: It inserts the element into the queue.
Example 1: Output:
5
6
Example 2: Output:
10
12
13
Reference: https://devdocs.io/ruby~2.5/queue#method-i-3C-3C
Comment
Article Tags: