Posts /

Declarations and Expressions

04 Apr 2017

선언(declaration)

표현식(Expression)

IIFE(즉시호출함수표현식)

(showName = function (name) {
    console.log(name || "No Name")
    }
) (); // No Name
showName("Rich"); // Rich
showName(); // No Name

Global scope를 오염시키지 않기 위해 사용.


Twitter Facebook Google+