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
gfnork node.js workshop Lesson #1 JavaScript Ba...
Search
gfnork
November 29, 2014
Programming
0
940
gfnork node.js workshop Lesson #1 JavaScript Basics
syntax, operators, loops, conditionals, functions
gfnork
November 29, 2014
Tweet
Share
More Decks by gfnork
See All by gfnork
Basic Mobile Application Design
freundschaft
0
500
gfnork node.js workshop Lesson #2 JavaScript Async
freundschaft
0
940
gfnork node.js workshop Lesson #3 node.js basics
freundschaft
0
460
gfnork node.js workshop Lesson #4 middleware for node
freundschaft
0
500
gfnork node.js workshop Lesson #5 node.js databases
freundschaft
0
470
gfnork node.js workshop Lesson #6 Unit testing
freundschaft
0
460
Other Decks in Programming
See All in Programming
為你自己學 Python - 冷知識篇
eddie
1
350
250830 IaCの選定~AWS SAMのLambdaをECSに乗り換えたときの備忘録~
east_takumi
0
390
請來的 AI Agent 同事們在寫程式時,怎麼用 pytest 去除各種幻想與盲點
keitheis
0
120
go test -json そして testing.T.Attr / Kyoto.go #63
utgwkk
3
310
実用的なGOCACHEPROG実装をするために / golang.tokyo #40
mazrean
1
280
より安全で効率的な Go コードへ: Protocol Buffers Opaque API の導入
shwatanap
1
110
Putting The Genie in the Bottle - A Crash Course on running LLMs on Android
iurysza
0
140
複雑なフォームに立ち向かう Next.js の技術選定
macchiitaka
2
140
RDoc meets YARD
okuramasafumi
4
170
Introducing ReActionView: A new ActionView-compatible ERB Engine @ Rails World 2025, Amsterdam
marcoroth
0
690
はじめてのMaterial3 Expressive
ym223
2
770
「手軽で便利」に潜む罠。 Popover API を WCAG 2.2の視点で安全に使うには
taitotnk
0
860
Featured
See All Featured
The World Runs on Bad Software
bkeepers
PRO
70
11k
Embracing the Ebb and Flow
colly
87
4.8k
Statistics for Hackers
jakevdp
799
220k
Automating Front-end Workflow
addyosmani
1370
200k
Into the Great Unknown - MozCon
thekraken
40
2k
Fireside Chat
paigeccino
39
3.6k
Product Roadmaps are Hard
iamctodd
PRO
54
11k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
53
2.9k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
1.6k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
The Power of CSS Pseudo Elements
geoffreycrofte
77
6k
Visualization
eitanlees
148
16k
Transcript
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