function: simple piece of the code we can simply use oer and over again in our code, it is like varable but for whole chunks of codes. It is also expression!!
funtion is vaule
this is very new term that just introduce. very simple when we are dealing with only one line.
paramenter와 argument헷갈리지 말것
parameter = placeholder
arguments = actual value that use to fill in placeholder
calling = running=invocking function 전부 같은뜻!!!!
When we are calling code inside the function we use term 'calling the function'. However we also uses 'invokes the funtion' when we are indirectly excuting the function such as a
fn.call();
fn.apply();
근데 크게 상관은 없을듯, but doesn't matter that much..
JavaScript will will stop excuting the statement after meeting return statement.
return ;
자바스크립트는 함수 안에서 명령문들을 실행하다가 return을 만나면 함수를 빠져나간다. 그리고 return문에 있는것을 반환하게 된다.
Functions often compute a return value. The return value is "returned" back to the "caller":
function sso(a,b){
morning = a+b;
return morning;
}
sso(2,3);