Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Javascript Closures
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
bjelli
July 18, 2012
Programming
910
3
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Javascript Closures
a short introduction (in javascript + german)
bjelli
July 18, 2012
More Decks by bjelli
See All by bjelli
Intro to Web- and Mobile-Developement
bjelli
0
330
Railsgirls: Where did my HTML and CSS go
bjelli
0
620
Berufe im World Wide Web
bjelli
0
270
Teach (all the) Rails
bjelli
0
450
Ruby One-Liners
bjelli
1
350
Other Decks in Programming
See All in Programming
Gmail/Google DriveをトリガーにAIエージェントを動かそう! / Run AI agents with Gmail/Google Drive as triggers!
har1101
3
460
XHTMLが残したもの
yosuke_furukawa
PRO
1
380
LoopHub - ローカルで動く GitHub で、AI と共同開発
jugyo
0
380
一参加者から『中の人』へ 〜全通PHPerがブースに立って学んだ、カンファレンスを100倍楽しむコツ〜
wp_daisuke
0
110
型解析で実現する Go の言語内 DSL / Conference に Go! タイムテーブルの歩き方 for Gophers
mazrean
0
120
ALB ログから Trace を気合で繋げる技術
fohte
7
860
コンパウンドプロダクト開発のためのローカルプロセスマネージャー再発明 #layerxgo
izumin5210
0
620
ハーネス設計入門 〜プロンプト、コンテキストの次〜
kinopeee
53
34k
AI時代に学ぶ 好きなルール 嫌いなルール Linter編
shorty5121
0
800
MySQLとPostgreSQLって何が違うの?
akagami
PRO
0
160
20260828_品質と開発生産性を両立させる、AI時代のE2Eテストの考え方
magicpod
0
130
Pythonの実行はどこまで賢くなったのか? CPythonとPyPyから見る最適化のしくみ
curekoshimizu
4
2.7k
Featured
See All Featured
The Illustrated Children's Guide to Kubernetes
chrisshort
51
53k
Why You Should Never Use an ORM
jnunemaker
PRO
61
10k
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
370
Ten Tips & Tricks for a 🌱 transition
stuffmc
0
180
State of Search Keynote: SEO is Dead Long Live SEO
ryanjones
0
260
How to Grow Your eCommerce with AI & Automation
katarinadahlin
PRO
1
260
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
450
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
2
490
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.8k
Typedesign – Prime Four
hannesfritz
42
3.2k
Ethics towards AI in product and experience design
skipperchong
2
360
Lightning Talk: Beautiful Slides for Beginners
inesmontani
PRO
2
660
Transcript
Javascript Closures
function r1( s, x ) { var result = "";
while( x ) { result += s; x--; } return s; } http://jsfiddle.net/bjelline/54dRs/ Funktionen in JS
r2 = function ( s, x ) { var result
= ""; while( x ) { result += s; x--; } return result; } http://jsfiddle.net/bjelline/54dRs/ Funktionen in JS
etwas, das als Übergabeparameter oder Rückgabewert einer Funktion oder Prozedur
auftritt bzw. einer Variable zugewiesen werden kann. Functions as first class citizens...
function mk_function() { return function() { return "Rückgabewert"; }; }
f = mk_function(); f(); g = f; Funktionen in JS
function mk_function() { var a = 42; return function() {
return "Rückgabewert ist " + a; }; } f = mk_function(); f(); innere Funktionen + vars
function mk_sammler() { var gesammelt = ""; return function(s) {
gesammelt += s; return gesammelt; }; } f = mk_sammler(); http://jsfiddle.net/bjelline/jhqbq/ innere Funktionen + vars
Für die Funktion bleibt auch die Variable erhalten Closure