Tweakr
    Preparing search index...

    Function keys

    • Returns an array of the keys of the given object.

      Type Parameters

      • T extends object

      Parameters

      • obj: T

        The object whose keys will be retrieved.

      Returns (keyof T)[]

      An array of the object's keys.

      const obj = { a: 1, b: 2 };
      const result = keys(obj);
      console.log(result); // ["a", "b"]

      1.1.0