Advertisement
leomaster

Natural Numbers JS

Jul 21st, 2018
208
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const NN = function() {
  2.     let n = 0;
  3.     return {
  4.         [Symbol.iterator]() {
  5.             return this;
  6.         },
  7.         next() {
  8.             return { value: n++ };
  9.         }
  10.     }
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement