Files
test-repo/tests/format/js/babel-plugins/function-sent.js
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

10 lines
268 B
JavaScript
Raw Normal View History

2020-05-29 09:26:52 +08:00
// https://babeljs.io/docs/en/babel-plugin-proposal-function-sent
function* generator() {
console.log("Sent", function.sent);
console.log("Yield", yield);
}
const iterator = generator();
iterator.next(1); // Logs "Sent 1"
iterator.next(2); // Logs "Yield 2"