Advertisement
Guest User

Untitled

a guest
Jan 19th, 2017
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. 'use strict';
  2.  
  3. console.clear();
  4.  
  5. var source = [0, 1, 2, 3, 4, 5];
  6.  
  7. source.filter(function (x) {
  8. return x % 2 === 1;
  9. }).map(function (x) {
  10. return x + '!';
  11. }).forEach(function (x) {
  12. return console.log(x);
  13. });
  14.  
  15. //console.clear();
  16.  
  17. console.log("observable");
  18. var source1 = Rx.Observable.fromArray([0, 1, 2, 3, 4, 5]);
  19.  
  20. source1.filter(x => x % 2 === 0 )
  21. .map(x => x +'!')
  22. .forEach(x => console.log(x));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement