pluck

signature: pluck(properties: ...args): Observable

Example 1: Pluck object property
Example 2: Pluck nested properties
  1. import { from } from 'rxjs/observable/from';
  2. import { pluck } from 'rxjs/operators';
  3. const source = from([
  4. { name: 'Joe', age: 30, job: { title: 'Developer', language: 'JavaScript' } },
  5. ]);
  6. //grab title property under job
  7. const example = source.pipe(pluck('job', 'title'));

Additional Resources


  • :newspaper: - Official docs