• Returns value's keys.

    Parameters

    • value: unknown

    Returns PropertyKey[]

    Since

    1.0.0

    Example

    keys({ a: 0, b: 1, c: 2 });
    // => ["a", "b", "c"]

    Example

    function Foo() {
    this.a = 1
    this.b = 2
    }

    Foo.prototype.c = 3

    keys(new Foo)
    // => ["a", "b"] (iteration order is not guaranteed)

    Example

    keys("hi")
    // => ["0", "1"]