happy-rusty
    Preparing search index...

    Variable None

    None: None

    A constant representing the None case of an Option, indicating the absence of a value. This constant is frozen to ensure it is immutable and cannot be altered, preserving the integrity of None throughout the application.

    1.0.0

    // Use None to represent absence of a value
    function findUser(id: number): Option<User> {
    const user = users.find(u => u.id === id);
    return user ? Some(user) : None;
    }

    // None is a singleton, so you can compare by reference
    const result = findUser(999);
    if (result === None) {
    console.log('User not found');
    }

    // Use with Option methods
    const name = None.unwrapOr('Anonymous'); // 'Anonymous'