0

Is there a way to express iterable function in lambda style?

const externalVal = 3;

function* myGenerator1() {
   yield 1;
   yield 2;
   yield externalVal;
   yield this.something; // might not working, use lambda expression is better
}

const myGenerator2 = () => { // error
   yield 1;
   yield 2;
   yield externalVal;
   yield this.something;
}
Heyyy Marco
  • 633
  • 1
  • 12
  • 22

0 Answers0