标签:yield char next fun rip script doc lang round
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>yield传参ld可以</title> <script src="./jquery3.1.0.js"></script> </head> <body> <script> function *show(num1,num2) { console.log(`${num1},${num2}`) console.log(‘a‘) let a =yield ; console.log(‘b‘); console.log(a) } let gen = show(99,98); gen.next(111); //没法给yield传参的 gen.next(123); </script> </body> </html>
运行结果
标签:yield char next fun rip script doc lang round
原文地址:https://www.cnblogs.com/malong1992/p/12129581.html