.
.
A function is re-usable code!
関数は再利用可能なコードです。
.
One important aspect of functions is the ability to return an output. Let's take a look at this closely.
関数の重要な側面の1つは、出力を返す能力です。これについて詳しく見てみましょう。
.
function getNumber() {
return 4;
}
.
In this case, the number
4is always returned when we callgetNumber. Calling the function would look like this:
この場合、getNumberを呼び出すたびに常に数字4が返されます。関数を呼び出すには次のようになります。
.
const num = getNumber();
.
The value
4would now be stored in our variablenum!
これで、num変数に4が格納されます!
.
Explore the syntax of functions more in details.
関数の構文をもっと詳しく調べてみましょう。
.
.
.
In the
getMessagefunction return a string. It can be any string that you choose!
getMessage関数から文字列を返してください。好きな文字列でかまいません!
.
Once you have done this, click "Run Tests" or hit the
enterkey to move forward!
これを行ったら、「Run Tests」をクリックするか、Enterキーを押して進みましょう!
.
.
.

