Last active
May 28, 2018 14:57
-
-
Save Rob117/c7c5d40825b54cd09e0130994e3f3dd5 to your computer and use it in GitHub Desktop.
This is how a function works
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// function FUNCTIONAME (引数1、引数2){ | |
// 何かの計算か行動をして | |
// 値を返す(任意) | |
// return SOMESTUFF | |
// } | |
function addTwoThings(thingOne, thingTwo){ | |
return thingOne + thingTwo; | |
} | |
words = addTwoThings('bat ', 'man'); // wordsの入っている値は 'bat man' | |
numbers = addTwoThings(110, 220); // numbersの入ってる値は 330 | |
console.log('first result: ' + words); | |
console.log('seconds result: ' + numbers); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment