SlideShare a Scribd company logo
S O L I D
J AVA S C R I P T
C O D I N G
M A Y 2 4 , 2 0 1 5 - D I WA D E L M U N D O / V O YA G E R I N N O VA T I O N S
JavaScript is …
– C H A R L E S J O S E P H U Y
“swiss army knife romance.”
JavaScript is …
– M A . C Z A R I N A S . B O N G AT
“is a cool scripting language but hard to learn.”
JavaScript is …
– S A M U E L F R A N C I S C O
“the language to rule them all.”
JavaScript is …
- S E T A B A S E S TA N D A R D F O R
J AVA S C R I P T D E V E L O P M E N T
W H Y A R E W E H E R E ?
- F O S T E R A
C O L L A B O R AT I V E
E N V I R O N M E N T F O R
J AVA S C R I P T
K N O W L E D G E L E A R N I N G
- G E T T O G E T H E R A N D
H AV E L U N C H !
O V E R V I E W O F T O D AY ’ S S E S S I O N
• JavaScript Review - Diwa del Mundo
• Object-Oriented Programming in JS - Zander
Magtipon
• JavaScript Anti-Patterns - Russell Santos
• JS Race Conditions - Arisa Ochavez
• ECMAScript 6 - Ruel Pagayon
git clone https://goo.gl/fNA4Ex
// If you have nvm:
nvm use v0.12
node
J AVA S C R I P T R E V I E W
• Variables, Globals
• Functions (Scopes, Constructor Functions, Self-
executing)
• Object Literals and the “new” operator
• Closures
1 . VA R I A B L E S . J S
• Primitives
• typeof
2 . O B J E C T-
L I T E R A L S . J S
• You can create variables
either by literals or built-in
constructors
• Object literals: key-value
notation
• For non-custom objects,
you’ll use literals most of
the time
3 . VA R S -
G L O B A L S . J S
• Variables are declared via
‘var’, optional but
recommended
• Not using ‘var’ makes your
variable an implied global
• Implied globals can be
deleted, explicit globals
cannot be deleted
4 . N O T E S - O N - T H I S . J S
• The variable ‘this’ inside a non-constructor function points to the
global object
global
5 . H O I S T I N G . J S
• Hoisting refers to the
‘jump to top’ behaviour of
the JavaScript interpreter
• Interpreter “preprocesses”
code
6 . F U N C T I O N S . J S
• Functions are 1st-class objects in JS:
they have properties and methods
• They provide scope
• Created dynamically, assigned,
copied by reference
• Can be passed as arguments to
other functions

• Types: function declarations,
functional expression, named
functional expression
I M M E D I AT E
F U N C T I O N S A N D
C U R RY I N G
• Immediate functions
executes immediately -
good for initialisation
• Currying - partial
application of functions -
good when calling
functions with similar
arguments
N E W
7 . C O N S T R U C T O R -
F U N C T I O N S . J S
• You can create object
instances using the ‘new’
operator
• “Objects” are defined via
constructor functions
• ‘this’ refers to the instance
http://www.thehindu.com/multimedia/dynamic/00846/20SM_VIJAY_846767f.jpg
– C H A P T E R 3 , E X P E R T J AVA S C R I P T ( D A G G E T T )
A closure is the act of binding all free variables and
functions into a closed expression that persist
beyond the lexical scope from which they were
created.
8 . C L O S U R E S . J S
• Most basic definition: an
outer function that returns
an inner function
• A way to have access to
variables and functions
that it shouldn’t have
S U M M A RY
• Use literals.
• Define objects through constructor functions.
• Understand ‘this’.
• Learn functions by heart.
• Whatever happens, make sure you know closures.
Colophon
The animal in the photo in this presentation is a Tarsier.
References
See References.md
JavaScript Patterns
Expert JavaScript

More Related Content

Similar to Solid JavaScript Coding (20)

PDF
High quality Front-End
David Simons
 
PDF
New Android Languages
Javier Gamarra
 
PDF
The Swift Architect
Natasha Murashev
 
PDF
Java script core
Vaishnu Vaishu
 
PDF
Witchcraft
Brooklyn Zelenka
 
PDF
[HUN][Hackersuli] Androidos alkalmazássebészet, avagy gumikesztyűt fel és irá...
hackersuli
 
PDF
Java 20
Joe Kutner
 
PDF
Data Modelling at Scale
David Simons
 
PDF
Angular server side rendering with NodeJS - In Pursuit Of Speed
Ilia Idakiev
 
PPTX
Nodejs from zero to hero
Nicola Del Gobbo
 
PDF
ITB2016 - ColdBox 4 Modules
Ortus Solutions, Corp
 
PDF
Elasticsearch at EyeEm
Lars Fronius
 
PDF
Bristol Uni - Use Cases of NoSQL
David Simons
 
PDF
Zend con 2016 - Asynchronous Prorgamming in PHP
Adam Englander
 
PPTX
Ceph Day KL - Bluestore
Ceph Community
 
PDF
Develop realtime web with Scala and Xitrum
Ngoc Dao
 
PPT
A Deeper look into Javascript Basics
Mindfire Solutions
 
PDF
Introduction to JavaScript for Modern Software Development
Kenneth Geisshirt
 
PDF
A practical look at your first laravel angular js app
John Fischelli
 
PDF
RxJava@DAUG
Maxim Volgin
 
High quality Front-End
David Simons
 
New Android Languages
Javier Gamarra
 
The Swift Architect
Natasha Murashev
 
Java script core
Vaishnu Vaishu
 
Witchcraft
Brooklyn Zelenka
 
[HUN][Hackersuli] Androidos alkalmazássebészet, avagy gumikesztyűt fel és irá...
hackersuli
 
Java 20
Joe Kutner
 
Data Modelling at Scale
David Simons
 
Angular server side rendering with NodeJS - In Pursuit Of Speed
Ilia Idakiev
 
Nodejs from zero to hero
Nicola Del Gobbo
 
ITB2016 - ColdBox 4 Modules
Ortus Solutions, Corp
 
Elasticsearch at EyeEm
Lars Fronius
 
Bristol Uni - Use Cases of NoSQL
David Simons
 
Zend con 2016 - Asynchronous Prorgamming in PHP
Adam Englander
 
Ceph Day KL - Bluestore
Ceph Community
 
Develop realtime web with Scala and Xitrum
Ngoc Dao
 
A Deeper look into Javascript Basics
Mindfire Solutions
 
Introduction to JavaScript for Modern Software Development
Kenneth Geisshirt
 
A practical look at your first laravel angular js app
John Fischelli
 
RxJava@DAUG
Maxim Volgin
 

Recently uploaded (20)

PPTX
Tally_Basic_Operations_Presentation.pptx
AditiBansal54083
 
PDF
Thread In Android-Mastering Concurrency for Responsive Apps.pdf
Nabin Dhakal
 
PPTX
Home Care Tools: Benefits, features and more
Third Rock Techkno
 
PPTX
Hardware(Central Processing Unit ) CU and ALU
RizwanaKalsoom2
 
PPTX
Equipment Management Software BIS Safety UK.pptx
BIS Safety Software
 
PDF
Automate Cybersecurity Tasks with Python
VICTOR MAESTRE RAMIREZ
 
PDF
Build It, Buy It, or Already Got It? Make Smarter Martech Decisions
bbedford2
 
PDF
Understanding the Need for Systemic Change in Open Source Through Intersectio...
Imma Valls Bernaus
 
PDF
유니티에서 Burst Compiler+ThreadedJobs+SIMD 적용사례
Seongdae Kim
 
PPTX
In From the Cold: Open Source as Part of Mainstream Software Asset Management
Shane Coughlan
 
PPTX
Agentic Automation: Build & Deploy Your First UiPath Agent
klpathrudu
 
PDF
MiniTool Partition Wizard 12.8 Crack License Key LATEST
hashhshs786
 
PPTX
Empowering Asian Contributions: The Rise of Regional User Groups in Open Sour...
Shane Coughlan
 
PDF
iTop VPN With Crack Lifetime Activation Key-CODE
utfefguu
 
PDF
Why Businesses Are Switching to Open Source Alternatives to Crystal Reports.pdf
Varsha Nayak
 
PPTX
Migrating Millions of Users with Debezium, Apache Kafka, and an Acyclic Synch...
MD Sayem Ahmed
 
PDF
HiHelloHR – Simplify HR Operations for Modern Workplaces
HiHelloHR
 
PPTX
Why Businesses Are Switching to Open Source Alternatives to Crystal Reports.pptx
Varsha Nayak
 
PDF
The 5 Reasons for IT Maintenance - Arna Softech
Arna Softech
 
PDF
Efficient, Automated Claims Processing Software for Insurers
Insurance Tech Services
 
Tally_Basic_Operations_Presentation.pptx
AditiBansal54083
 
Thread In Android-Mastering Concurrency for Responsive Apps.pdf
Nabin Dhakal
 
Home Care Tools: Benefits, features and more
Third Rock Techkno
 
Hardware(Central Processing Unit ) CU and ALU
RizwanaKalsoom2
 
Equipment Management Software BIS Safety UK.pptx
BIS Safety Software
 
Automate Cybersecurity Tasks with Python
VICTOR MAESTRE RAMIREZ
 
Build It, Buy It, or Already Got It? Make Smarter Martech Decisions
bbedford2
 
Understanding the Need for Systemic Change in Open Source Through Intersectio...
Imma Valls Bernaus
 
유니티에서 Burst Compiler+ThreadedJobs+SIMD 적용사례
Seongdae Kim
 
In From the Cold: Open Source as Part of Mainstream Software Asset Management
Shane Coughlan
 
Agentic Automation: Build & Deploy Your First UiPath Agent
klpathrudu
 
MiniTool Partition Wizard 12.8 Crack License Key LATEST
hashhshs786
 
Empowering Asian Contributions: The Rise of Regional User Groups in Open Sour...
Shane Coughlan
 
iTop VPN With Crack Lifetime Activation Key-CODE
utfefguu
 
Why Businesses Are Switching to Open Source Alternatives to Crystal Reports.pdf
Varsha Nayak
 
Migrating Millions of Users with Debezium, Apache Kafka, and an Acyclic Synch...
MD Sayem Ahmed
 
HiHelloHR – Simplify HR Operations for Modern Workplaces
HiHelloHR
 
Why Businesses Are Switching to Open Source Alternatives to Crystal Reports.pptx
Varsha Nayak
 
The 5 Reasons for IT Maintenance - Arna Softech
Arna Softech
 
Efficient, Automated Claims Processing Software for Insurers
Insurance Tech Services
 
Ad

Solid JavaScript Coding

  • 1. S O L I D J AVA S C R I P T C O D I N G M A Y 2 4 , 2 0 1 5 - D I WA D E L M U N D O / V O YA G E R I N N O VA T I O N S
  • 3. – C H A R L E S J O S E P H U Y “swiss army knife romance.” JavaScript is …
  • 4. – M A . C Z A R I N A S . B O N G AT “is a cool scripting language but hard to learn.” JavaScript is …
  • 5. – S A M U E L F R A N C I S C O “the language to rule them all.” JavaScript is …
  • 6. - S E T A B A S E S TA N D A R D F O R J AVA S C R I P T D E V E L O P M E N T W H Y A R E W E H E R E ? - F O S T E R A C O L L A B O R AT I V E E N V I R O N M E N T F O R J AVA S C R I P T K N O W L E D G E L E A R N I N G - G E T T O G E T H E R A N D H AV E L U N C H !
  • 7. O V E R V I E W O F T O D AY ’ S S E S S I O N • JavaScript Review - Diwa del Mundo • Object-Oriented Programming in JS - Zander Magtipon • JavaScript Anti-Patterns - Russell Santos • JS Race Conditions - Arisa Ochavez • ECMAScript 6 - Ruel Pagayon
  • 9. J AVA S C R I P T R E V I E W • Variables, Globals • Functions (Scopes, Constructor Functions, Self- executing) • Object Literals and the “new” operator • Closures
  • 10. 1 . VA R I A B L E S . J S • Primitives • typeof
  • 11. 2 . O B J E C T- L I T E R A L S . J S • You can create variables either by literals or built-in constructors • Object literals: key-value notation • For non-custom objects, you’ll use literals most of the time
  • 12. 3 . VA R S - G L O B A L S . J S • Variables are declared via ‘var’, optional but recommended • Not using ‘var’ makes your variable an implied global • Implied globals can be deleted, explicit globals cannot be deleted
  • 13. 4 . N O T E S - O N - T H I S . J S • The variable ‘this’ inside a non-constructor function points to the global object global
  • 14. 5 . H O I S T I N G . J S • Hoisting refers to the ‘jump to top’ behaviour of the JavaScript interpreter • Interpreter “preprocesses” code
  • 15. 6 . F U N C T I O N S . J S • Functions are 1st-class objects in JS: they have properties and methods • They provide scope • Created dynamically, assigned, copied by reference • Can be passed as arguments to other functions
 • Types: function declarations, functional expression, named functional expression
  • 16. I M M E D I AT E F U N C T I O N S A N D C U R RY I N G • Immediate functions executes immediately - good for initialisation • Currying - partial application of functions - good when calling functions with similar arguments
  • 17. N E W
  • 18. 7 . C O N S T R U C T O R - F U N C T I O N S . J S • You can create object instances using the ‘new’ operator • “Objects” are defined via constructor functions • ‘this’ refers to the instance
  • 20. – C H A P T E R 3 , E X P E R T J AVA S C R I P T ( D A G G E T T ) A closure is the act of binding all free variables and functions into a closed expression that persist beyond the lexical scope from which they were created.
  • 21. 8 . C L O S U R E S . J S • Most basic definition: an outer function that returns an inner function • A way to have access to variables and functions that it shouldn’t have
  • 22. S U M M A RY • Use literals. • Define objects through constructor functions. • Understand ‘this’. • Learn functions by heart. • Whatever happens, make sure you know closures.
  • 23. Colophon The animal in the photo in this presentation is a Tarsier. References See References.md JavaScript Patterns Expert JavaScript