pop

Summary

Returns and removes the earliest element added to the queue.

Usage

public T+ pop()

Returns

The removed element or undefined if the queue was empty.

Description

Returns and removes the earliest element added to the queue. If the queue is empty, undefined will be returned.

Examples

Basic Usage
1
2
3
4
5
import System;
 
auto queue = new Queue<int>([ 1, 2 ]);
Console.log(queue.pop()); // 1
Console.log(queue.pop()); // 2

Share

HTML | BBCode | Direct Link