本文介绍了是的`do ... while`循环遗漏了CoffeeScript ...?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 在CoffeeScript中, while 循环标准: while但是,以下 不工作: do y() while x() 这只是第一个例子的糖: y()while x() 解决方案 CoffeeScript文档说: CoffeeScript提供的唯一的低级循环是while循环。 我不知道一个内置循环执行至少一次,所以我想替代是 loop y() break if x() In CoffeeScript, the while loop comes standard:while x() y()However, the following doesn't work:do y()while x()And this is simply sugar for the first example:y() while x()Does CoffeeScript come with a built-in loop that executes at least once?As an aside, do is a keyword — it's used to call anonymous functions. 解决方案 The CoffeeScript documentation says: The only low-level loop that CoffeeScript provides is the while loop.I don't know of a built-in loop that executes at least once, so I guess the alternative isloop y() break if x() 这篇关于是的`do ... while`循环遗漏了CoffeeScript ...?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
08-31 07:23