• Jump To … +
    _.array.builders.js.md _.array.selectors.js.md _.collections.walk.js.md _.function.arity.js.md _.function.combinators.js.md _.function.iterators.js.md _.function.predicates.js.md _.object.builders.js.md _.object.selectors.js.md _.util.existential.js.md _.util.operators.js.md _.util.strings.js.md _.util.trampolines.js.md index.md
  • _.util.existential.js.md

  • ¶

    util.existential

    Functions which deal with whether a value “exists.”


  • ¶

    exists

    Signature: _.exists(value:Any)

    Checks whether or not the value is “existy.” Both null and undefined are considered non-existy values. All other values are existy.

    _.exists(null);
    // => false
    
    _.exists(undefined);
    // => false
    
    _.exists({});
    // = > true
    
    _.exists("Sparta");
    // => true
    

  • ¶

    falsey

    Signature: _.falsey(value:Any)

    Checks whether the value is falsey. A falsey value is one which coerces to false in a boolean context.

    _.falsey(0);
    // => true
    
    _.falsey("");
    // => true
    
    _.falsey({});
    // => false
    
    _.falsey("Corinth");
    // => false
    

  • ¶

    firstExisting

    Signature: _.firstExisting(value:Any[, value:Any...])

    Returns the first existy argument from the argument list.

    _.firstExisting("Socrates", "Plato");
    // => "Socrates"
    
    _.firstExisting(null, undefined, "Heraclitus");
    // => "Heraclitus"
    

  • ¶

    not

    Signature: _.not(value:Any)

    Returns a boolean which is the opposite of the truthiness of the original value.

    _.not(0);
    // => true
    
    _.not(1);
    // => false
    
    _.not(true);
    // => false
    
    _.not(false);
    // => true
    
    _.not({});
    // => false
    
    _.not(null);
    // => true
    

  • ¶

    truthy

    Signature: _.truthy(value:Any)

    Checks whether the value is truthy. A truthy value is one which coerces to true in a boolean context.

    _.truthy({});
    // => true
    
    _.truthy("Athens");
    // => true
    
    _.truthy(0);
    // => false
    
    _.truthy("");
    // => false
    

  • ¶