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
Even Rubber Duck knows JS better than you!
Search
Nikita Galkin
September 08, 2018
Programming
130
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Even Rubber Duck knows JS better than you!
Nikita Galkin
September 08, 2018
More Decks by Nikita Galkin
See All by Nikita Galkin
React applications Failures
galkin
0
320
Node.js Development in 2022
galkin
0
870
Cloud Native Approach for Node.js Developers
galkin
0
110
Deep Dive Into NestJS at FWDays
galkin
0
540
Node.js Recipes: Road to Production.
galkin
0
220
Auth for React.js App
galkin
1
180
Web Developer Toolbox at 2020
galkin
1
250
Node.js Development in 2020: trends and techniques
galkin
0
590
Backend For Frontend: The Missing Manual at Devoxx Ukraine
galkin
1
180
Other Decks in Programming
See All in Programming
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
320
[Rails World 2026] Durable orchestration on Rails: from continuation to workflow
palkan
1
350
すこし踏み込む CancellationToken
htkym
2
1.3k
App Intentsのビルドプロセスを支える技術
kntkymt
0
460
KiroのSpecで「五目並べ」を作ってみる
satoshi256kbyte
1
270
モバイル交通系ICへのチャージ実例から考える、クロスプラットフォーム開発におけるiOS実機テスト設計とCI運用
yusuga
1
550
手動確認はもう限界 〜XCUITestでCustom URL Schemeの遷移を起動種別ごとに自動テストする〜 / Testing Custom URL Schemes with XCUITest
otouto
0
350
ハーネス設計入門 〜 基礎知識の整理から実務へのステップアップ 〜
kinopeee
18
18k
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
580
AWSに止められる覚悟してますか?
morizo_1984
2
460
Heart of Swift Concurrency
koher
0
1k
AI が書く Go コードの品質を劇的に向上させる Linter: “declscope”
mpyw
0
440
Featured
See All Featured
Winning Ecommerce Organic Search in an AI Era - #searchnstuff2025
aleyda
2
2.2k
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.9k
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
420
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
370
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
68
58k
Done Done
chrislema
187
17k
Exploring anti-patterns in Rails
aemeredith
4
520
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
560
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
710
GraphQLとの向き合い方2022年版
quramy
50
15k
Believing is Seeing
oripsolob
1
230
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
570
Transcript
Even Rubber Duck knows JavaScript better than you! by Nikita
Galkin Sep 8, 2018
Bug on line 7 Quack Quack
Your code is sucks Quack Quack
None
class Employee { constructor(role) { this.role = role; } get
mainResponsibility() { switch (this.role) { case 'Developer': return 'Write Code'; ...
Turn and Write Code
7 Hiring process 1. HR-interview 2. CV-screening 3. Technical interview
4. Interview with the client Dev Team
Upgraded Hiring process 1. HR-interview 2. CV-screening 3. Live coding
as fail fast check 4. Technical interview 5. Test task as second chance 6. Interview with the client 8
Live coding • 20 minutes only • Remote via skype
with screen-sharing • Without bla-bla bullshit • 4-6 trivial JS tasks at JSfiddle • Easy to see does the code work or not • Googling or Asking is okey 9
Expectations Reality VS
None
You lost context Quack
const obj = { fullname: 'Yellow Duck', getFullname: function() {
return this.fullname; } }; const nameGetter = obj.getFullname; // @todo fix this line document.getElementById('name').innerHTML = nameGetter();
const obj = { fullname: 'Yellow Duck', getFullname: function() {
return this.fullname; } }; const nameGetter = obj.getFullname; // @todo fix this line document.getElementById('name').innerHTML = obj.fullname;
const fullname = 'Yellow Duck'; const obj = { getFullname:
function() { return fullname; } }; const nameGetter = obj.getFullname; // @todo fix this line document.getElementById('name').innerHTML = nameGetter();
const obj = { fullname: 'Yellow Duck', getFullname: function() {
return this.fullname; } }; const nameGetter = obj.getFullname.bind(obj); document.getElementById('name').innerHTML = nameGetter();
17
Just return new promise Quack Quack
function wait(timeout) { // @todo implement } wait(1000) .then(() =>
{ document.getElementById('answer').innerHTML = 'Done!'; });
function wait(timeout) { return { then: function(callback) { callback(); }
} } wait(1000) .then(() => { document.getElementById('answer').innerHTML = 'Done!'; });
function wait(timeout) { setTimeout(function() {}, timeout); } wait(1000) .then(() =>
{ document.getElementById('answer').innerHTML = 'Done!'; });
function wait(timeout) { setTimeout(function() { return Promise(); }, timeout); }
wait(1000) .then(() => { document.getElementById('answer').innerHTML = 'Done!'; });
Release the Quacken!
function wait(timeout) { return new Promise(r => setTimeout(r, timeout)); }
wait(1000) .then(() => { document.getElementById('answer').innerHTML = 'Done!'; });
Use data structure Quack Quack
const unfiltered = [1, 2, 3, 5, 1, 5, 9,
1, 2, 8]; const filtered = removeDuplicates(unfiltered); // filtered should be equal [1, 2, 3, 5, 9, 8] document.getElementById('answer').innerHTML = filtered; function removeDuplicates(arr) { // @todo implement }
const unfiltered = [1, 2, 3, 5, 1, 5, 9,
1, 2, 8]; const filtered = removeDuplicates(unfiltered); // filtered should be equal [1, 2, 3, 5, 9, 8] document.getElementById('answer').innerHTML = filtered; function removeDuplicates(arr) { return arr.filter(...) }
Ducks win!
const unfiltered = [1, 2, 3, 5, 1, 5, 9,
1, 2, 8]; const filtered = removeDuplicates(unfiltered); // should be [1, 2, 3, 5, 9, 8] document.getElementById('answer').innerHTML = filtered; function removeDuplicates(arr) { const obj = {}; for (const el of arr) { obj[el] = true; } return Object.keys(obj); }
30 Googling is better, than learning JS
const unfiltered = [1, 2, 3, 5, 1, 5, 9,
1, 2, 8]; const filtered = removeDuplicates(unfiltered); // filtered should be equal [1, 2, 3, 5, 9, 8] document.getElementById('answer').innerHTML = filtered; function removeDuplicates(arr) { return Array.from(new Set(arr)); }
32 HAPPY CODING WITH JAVASCRIPT! You can find me at
twitter as @galk_in Slides are available at speakerdeck.com/galkin or at my site galk.in