Universeorange.com/Docs/

Priya library Function reference Global functions is.empty

    ready(() => {
        console.log(is.empty(this));
    });

This example uses this in the is.empty function and the window object is in this.
false should be logged in the console.

ready(() => {
    var variable = 0;

    // Evaluates to true because variable is empty
    if (is.empty(variable)) {
        console.log('variable is either 0, empty, or not set at all');
    }

    // Evaluates as true because variable is set
    if (is.set(variable)) {
        console.log('variable is set even though it is empty');
    }
});

Console F12:

variable is either 0, empty, or not set at all
variable is set even though it is empty

Last modified: 2021-06-07

© 2021 universeorange.com