Day-5.1 Java function 1

So Eun Ahn·2021년 1월 6일
0

JavaScript

목록 보기
6/26
post-custom-banner

function

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

1. function declarations

2. function exprestions

3. function arrows

this is very new term that just introduce. very simple when we are dealing with only one line.

paramenter와 argument헷갈리지 말것

parameter

parameter = placeholder

arguments

arguments = actual value that use to fill in placeholder

calling = running=invocking function 전부 같은뜻!!!!

Invocation

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..

Return

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);
profile
오늘도 새로운 도전을 한다
post-custom-banner

0개의 댓글