['< sod > an\'\'\'immediately - invoked function expression\'\'\'( or\'\'\'iife\'\' \', pronounced " iffy " < ref name = alman > { { cite web | last = alman | first = ben | title = immediately invoked function expressions | url = http : / / benalman. com / news / 2010 / 11 / immediately - invoked - function - expression | year = 2010 | accessdate = 4 february 2013 } } < / ref > ) is a [ [ javascript ] ] design pattern which produces a [ [ scope ( computer science ) | lexical scope ] ] using javascript\'s [ [ function scoping ] ]. immediately - invoked function expressions can be used to avoid [ [ javascript syntax # scoping _ and _ hoisting | variable hoisting ] ] from within blocks, protect against polluting the [ [ global variable | global environment ] ] and simultaneously allow public access to methods while retaining privacy for variables defined within the function. this pattern has been referred to as a\'\'\'self - executing anonymous function\'\' \', < ref > { { cite book | last = resig | first = john | title = pro javascript techniques | year = 2006 | publisher = apress | isbn = 9781430202837 | pages = 29 } } < / ref > but ben alman introduced the term iife as a more semantically accurate term for the pattern, shortly after its discussion arose on comp. lang. javascript. < ref name = alman / > < ref name = osmani > { { cite book | last = osmani | first = addy | title = learning javascript design patterns | year = 2012 | publisher = o\'reilly | isbn = 9781449334871 | pages = 206 } } < / ref > < eod > < sod > an\'\'\'immediately - invoked function expression\'\'\'( or\'\'\'iife\'\' \', pronounced " iffy " < ref name = alman > { { cite web | last = alman | first = ben | title = not immediately invoked function expressions | url = http : / / benalman. com / news / 2010 / 11 / immediately - invoked - function - expression | year = 2010 | accessdate = 4 february 2013 } } < / ref > ) is a [ [ javascript ] ] [ [ programming _ id ##iom | programming language idiom ] ] which produces a [ [ scope ( computer science ) | lexical scope ] ] using javascript\'s [ [ function scoping ] ]. immediately - invoked function expressions can be used to avoid [ [ javascript syntax # scoping _ and _ hoisting | variable hoisting ] ] from within blocks, protect against polluting the [ [ global variable | global environment ] ] and simultaneously allow public access to methods while retaining privacy for variables defined within the function. this pattern has been referred to as a\'\'\'self - executing anonymous function\'\' \', < ref > { { cite book | last = resig | first = john | title = pro javascript techniques | year = 2006 | publisher = apress | isbn = 9781430202837 | pages = 29 } } < / ref > but ben alman introduced the term iife as a more semantically accurate term for the pattern, shortly after its discussion arose on comp. lang. javascript. < ref name = alman / > < ref name = osmani > { { cite book | last = osmani | first = addy | title = learning javascript design patterns | year = 2012 | publisher = o\'reilly | isbn = 9781449334871 | pages = 206 } } < / ref > < eod >']