次のような関数定義の最後にセミコロンを追加する必要がありますか?
function helloWorld() {
//some code
}; //note the semicolon here at the end is it ever necessary? Ever
これはオプションだと誓う友人がいます。私はそれがオプションではないと思います私はそれが関数の終わりでオプションであることについて何も読んだことがありません。私は誰も「彼を除いて」それをするのを見たことがありません。セミコロンはオプションです。
var hellWorld = function (){
}; // the semicolon here it is optional because you are defining a variable this is OK and optional