Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "utils/define-nonenumerable-property/docs/types/index.d"

Index

Functions

Export assignment setNonEnumerableProperty

  • setNonEnumerableProperty(obj: any, prop: PropertyName, value: any): void
  • Defines a non-enumerable property.

    Notes

    • Non-enumerable properties are writable and configurable.

    Parameters

    • obj: any

      object on which to define the property

    • prop: PropertyName

      property name

    • value: any

      value to set

    Returns void

    Example

    var objectKeys = require( `@stdlib/utils/keys` );
    
    var obj = {};
    
    setNonEnumerableProperty( obj, 'foo', 'bar' );
    
    var v = obj.foo;
    // returns 'bar'
    
    var keys = objectKeys( obj );
    // returns []