// RxJS v6+
import { from } from 'rxjs';
import { pluck } from 'rxjs/operators';
const source = from([{ name: 'Joe', age: 30 }, { name: 'Sarah', age: 35 }]);
//names만 가져옵니다
const example = source.pipe(pluck('name'));
//결과: "Joe", "Sarah"
const subscribe = example.subscribe(val => console.log(val));
// RxJS v6+
import { from } from 'rxjs';
import { pluck } from 'rxjs/operators';
const source = from([
{ name: 'Joe', age: 30, job: { title: 'Developer', language: 'JavaScript' } },
//job 값이 없으면 undefined를 반환할 것입니다
{ name: 'Sarah', age: 35 }
]);
//job 안의 title프로퍼티를 뽑아냅니다
const example = source.pipe(pluck('job', 'title'));
//결과: "Developer" , undefined
const subscribe = example.subscribe(val => console.log(val));