Function objHas

  • Checks if an object has a specific key.

    Type Parameters

    • V

    Parameters

    Returns boolean

    Returns true if the object has the key, false otherwise.

    Example

    const myObj = { name: 'John', age: 30 };
    objHas(myObj, 'name');
    //=> true
    objHas(myObj, 'email');
    //=> false

Generated using TypeDoc