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

    Function objGetOwnPropertySymbols

    • The objGetOwnPropertySymbols() method returns an array of all symbol properties found directly upon the given object. Unlike Object.getOwnPropertyNames(), this method returns symbol properties only.

      Parameters

      • obj: any

        The object whose symbol properties are to be returned.

      Returns symbol[]

      An array of all symbol properties found directly upon the given object.

      0.12.0

      const obj = {};
      const a = Symbol('a');
      const b = Symbol.for('b');

      obj[a] = 'localSymbol';
      obj[b] = 'globalSymbol';

      const symbolProps = objGetOwnPropertySymbols(obj);

      console.log(symbolProps.length); // 2
      console.log(symbolProps[0] === a); // true
      console.log(symbolProps[1] === b); // true