isEmpty

Summary

Checks if the stack is empty.

Usage

public bool isEmpty()

Returns

true if the stack does not contain any elements and false otherwise.

Description

Checks if the stack is empty and contains zero elements.

Examples

Basic Usage
1
2
3
4
5
6
7
import System;
 
auto stack1 = new Stack<int>();
auto stack2 = new Stack<int>([ 1, 2, 3 ]);
 
Console.log(stack1.isEmpty()); // true
Console.log(stack2.isEmpty()); // false

Share

HTML | BBCode | Direct Link