Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
gfnork node.js workshop Lesson #1 JavaScript Ba...
Search
gfnork
November 29, 2014
Programming
1k
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
gfnork node.js workshop Lesson #1 JavaScript Basics
syntax, operators, loops, conditionals, functions
gfnork
November 29, 2014
Transcript
30 slides
None
2
3 var iable = 'hello world'; iable = 5; global_var
= 'hello world'; let knowledge = ''; 47 + 11; '47' + '11'; 47 + '11'; 47 + Number('11');
4 var
5
6 4 * 10 + 2; 4 * (10 +
2); var i = 3; iable += i++; iable = ++i;
7
8 var tru = 1, fals = 0, wtf =
2; tru || fals; wtf || fals; wtf || tru; tru || wtf; var tru = 1, fals = 0, wtf = 2; tru && fals; wtf && fals; wtf && tru; tru && wtf;
9 true false
10 'any string'; []; { }; 1; ''; NaN; null;
undefined;
11 var one = 1, two = 2, two_in_words =
'2'; one == two; one != two; two == two_in_words; two === two_in_words; two < one; two >= two_in_words;
12
13 if (one) console.log('hello noob!') else console.log('wtf'); console.log(true ? 'hello
noob!' : 'wtf'); var mind_twist = 'happens' && 'is annoying' ? 'with strange statements' && 'is real terror' : 'even if your skill' > 9000 || 'you work alone'; mind_twist == "is real terror" ? console.log("hello pro!") : 'wtf';
14 if else if else if else
15 switch (something) { case 'really interesting': alert('wow this case
is really interesting!'); break; case 42: alert('ok makes sense'); break; default: alert('no specific case was evaluated -> default'); break; }
16 for(var i = 0; i <= 9000; i++) console.log('power
level ' + i ); var go_on = true; while( go_on ) if( Math.random()*6 >= 5 ) go_on = false; do { // interesting thing still_interesting ? continue : break; } while ( i++ < 100 );
17 for while do do while
18 var Story = ['this', 'is', 'a story', 'all about',
'how my code', 'got', 'flipped turned upside down']; Story[2] + Story[5] + Story[6]; var Story2 = []; Story2.push(Story[0], Story[1], Story[4], Story[5], Story[2]); console.log(Story2 = Story2.join(' ')); console.log(Story2.split(' ')); Story2.length;
19 split join
20 var myObject = { sayHello : function() { console.log('hello');
}, myName : ‘gfnork' }; myObject.sayHello(); console.log(myObject.myName);
21
22 myObject.sayName = function () { console.log('my name is: '
+ this.myName); }; myObject.sayName(); var testObj = { sayName: myObject.sayName }; testObj.sayName();
23 this this this this this this
24 var TalkTo = function(person, msg) { var text =
msg + ', ' + person; console.log(text); }; TalkTo('Gfnork', 'What’s up'); var TextTo = function(person, msg) { return = msg + ', ' + person; };
25 var insult = function () { console.log('idiot!') }; var
praise = function () { console.log('good boy!') }; var teacher = function () { if (Math.random() < 0.5) return insult(); else return praise(); }; teacher(); teacher();
26
27 (function () { console.log('This output will be printed once!');
})(); var teacher = function () { var reaction = Math.random() < 0.5 ? function () { console.log('idiot!') }() : function () { console.log('good boy!') }(); return reaction; };
28
29
30
More Decks by gfnork
See All by gfnork
Basic Mobile Application Design
freundschaft
0
540
gfnork node.js workshop Lesson #2 JavaScript Async
freundschaft
0
1k
gfnork node.js workshop Lesson #3 node.js basics
freundschaft
0
480
gfnork node.js workshop Lesson #4 middleware for node
freundschaft
0
530
gfnork node.js workshop Lesson #5 node.js databases
freundschaft
0
490
gfnork node.js workshop Lesson #6 Unit testing
freundschaft
0
480
Other Decks in Programming
See All in Programming
作れるエンジニアから、価値を届けるエンジニアへ
ryunakayama
1
880
AIエージェントの「テストは通るのに本番で壊れる」を減らす
shibuiwilliam
3
120
AI時代のFlutter品質設計 — アプリ品質を守るQuality Layers
omatty198
0
390
眠らない開発チームの作り方
biwakonbu
0
110
はじめてのKubernetesコントリビューション
nasa9084
0
320
[DroidKnights 2026] Workflow AX: From Auto-Documented Policies to E2E Testing
raeminkang
0
610
AIコーディング時代のKotest ユニットテストから APIレベルの仕様固定化テストへ
ooga04
0
340
なぜ私たちは「現時点では」KMPの導入を見送ったのか
chigichan24
1
640
祈るテストから、探索するテストへ 〜Lincheckではじめる並行処理テスト〜
yyh_gl
0
430
高速開発を止めずに 性能を上げる Flyleのシステム刷新と改善の歴史
azihsoyn
0
110
コード生成時代のAPI定義を支えるRequest Spec移行
pvcresin
0
300
Kotlin Fest 2026: Kotlin コンパイラに Contribute してみよう! - Kotlin/Wasm で深い再帰を書けるようにした話
ternbusty
1
420
Featured
See All Featured
How to Grow Your eCommerce with AI & Automation
katarinadahlin
PRO
2
360
The #1 spot is gone: here's how to win anyway
tamaranovitovic
4
1.2k
Exploring anti-patterns in Rails
aemeredith
4
580
Building the Perfect Custom Keyboard
takai
2
970
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
133
20k
Reflections from 52 weeks, 52 projects
jeffersonlam
356
22k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
62k
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
700
Google's AI Overviews - The New Search
badams
0
1.7k
Art, The Web, and Tiny UX
lynnandtonic
304
22k
Measuring & Analyzing Core Web Vitals
bluesmoon
9
1.1k
Practical Orchestrator
shlominoach
192
12k