yield的用处我确实在第二个例子中没看出来,请解惑
老师 这个例子我确实没看出yield的用处 function getStockPrice () { return Math.random()*100; } var limitprice = 15 var price = 100 while(price > limitprice){ price = getStockPrice(); console.log(`price is ${price}`); } console.log(`buying price is ${price}`); 我这样也能跑出同样的效果,请解答我的疑惑