@nevware21/ts-utils
    Preparing search index...

    Function getLength

    • Helper to return the length value of an object, this will return the value of the "length" property. Generally used to return the length of a string or array.

      Type Parameters

      Parameters

      • value: T

        The value to return the length property from, must contain a length property

      Returns T["length"]

      0.4.2

      getLength("");               // returns 0
      getLength("Hello World"); // returns 11
      getLength([]); // returns 0;
      getLength([0, 1, 2, 3]); // returns 4;
      getLength({ length: 42}); // returns 42
      getLength({ length: () => 53; }); // returns the function that if called would return 53