[JavaScript]巻き上げのサンプル

2021年5月3日

書式
const 変数名 =関数名(引数1)
使用例

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<script>
const res = funcA(11, 22);
console.log(res);
/*関数の定義*/
function funcA(x, y) {
return x + y;
}
</script>
<script> const res = funcA(11, 22); console.log(res); /*関数の定義*/ function funcA(x, y) { return x + y; } </script>
<script>
  const res = funcA(11, 22); 
  console.log(res);
  
  /*関数の定義*/
  function funcA(x, y) {
    return x + y;
  }
</script>

結果
33

JavaScript

Posted by arkgame