简体   繁体   English

什么类型的构造是 JavaScript(或 Python 或 R)中的 for 循环

[英]What type of construct is a for loop in JavaScript (or Python or R)

I understand how to write a for loop and what it does.我了解如何编写 for 循环及其作用。 If I wanted, however, to understand it more deeply, could I describe it as a block statement that with a expected group of keywords and appropriate syntax is used for (a type of) conditional execution?但是,如果我想更深入地理解它,我是否可以将其描述为带有预期关键字组和适当语法的块语句,用于(一种)条件执行?

I'd say yes.我会说是的。 A for loop is a control-flow block structure, almost always with a calculable finite—often pre-defined—number of iterations, that performs the code inside the block. for 循环是一种控制流块结构,几乎总是具有可计算的有限(通常是预定义)迭代次数,用于执行块内的代码。 It often includes iterators so that the same algorithm within the block is applied to different elements as one traverses data.它通常包含迭代器,以便块内的相同算法在遍历数据时应用于不同的元素。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM