【GAS】Learn how to use the basic syntax of repeated sentences.(for)

Gerd AltmannによるPixabayからの画像

What is for?

For is a statement in a programming language to describe a loop,where the execution of a given statement is repeated only while the condition is true.

There are two types of loops for loops and while loops.A feature of the for statement is that it initializes a variable before entering the loop.

Syntax

The format of the for statement is as follows.

function myFunction() {
  let i;
  for(i=0;i<5;i++){
    console.log("%dtimes Hello World",i);
  }
}

summary

The basic syntax is very important. Please make sure you understand it and enjoy your programming life to the fullest.

Follow me!

【GAS】Learn how to use the basic syntax of repeated sentences.(for)” に対して1件のコメントがあります。

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です