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
900
3
Share
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
320
Railsgirls: Where did my HTML and CSS go
bjelli
0
590
Berufe im World Wide Web
bjelli
0
260
Teach (all the) Rails
bjelli
0
450
Ruby One-Liners
bjelli
1
340
Other Decks in Programming
See All in Programming
mruby on C#: From VM Implementation to Game Scripting (RubyKaigi 2026)
hadashia
2
520
AI時代のエンジニアリングの原則 / Engineering Principles in the AI Era
haru860
0
340
PHP で mp3 プレイヤーを実装しよう
m3m0r7
PRO
0
280
The Monolith Strikes Back: Why AI Agents ❤️ Rails Monoliths
serradura
0
340
Coding as Prompting Since 2025
ragingwind
0
830
AIエージェントで業務改善してみた
taku271
0
530
Angular Signal Forms
debug_mode
0
110
Claude Code × Gemini × Ebitengine ゲーム制作素人WebエンジニアがGoでゲームを作った話
webzawa
0
140
NakouPAY説明用
annouim0
0
170
10 Tips of AWS ~Gen AI on AWS~
licux
5
410
JOAI2026 1st solution - heron0519 -
heron0519
0
140
SREに優しいTerraform構成 modulesとstateの組み方
hiyanger
2
130
Featured
See All Featured
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
2
760
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
B2B Lead Gen: Tactics, Traps & Triumph
marketingsoph
0
100
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
250
Building a A Zero-Code AI SEO Workflow
portentint
PRO
0
450
4 Signs Your Business is Dying
shpigford
187
22k
Ten Tips & Tricks for a 🌱 transition
stuffmc
0
99
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
0
210
Design in an AI World
tapps
1
200
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
122
21k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.4k
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
370
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