import { from } from 'rxjs';
import { filter } from 'rxjs/operators';
const getTemperature = city => 100 / city.length;
/* Create an Observable from an array : Strasbourg => Nice => Lyon. */
const city$ = from(['Strasbourg', 'Nice', 'Lyon']);
const hotCity$ = city$
.pipe(filter(city => getTemperature(city) > 20));
hotCity$.subscribe(city => console.log(city));