SlideShare a Scribd company logo
JAVASCRIPT DOJO
Lessons and thoughts
from DevWeek
TALKS ATTENDED
• “Modern JavaScript” - K. Scott Allen
• “Just because it’s JavaScript doesn’t give you
the right to write rubbish!” – Hadi Hariri
• Mobile development with MVC4 and jQuery
Mobile – Brock Allen
Nobody
knows
JavaScript!
DOUBLE AND TRIPLE EQUALS
a)1 == “1”
a)1 == true
a)“1” == true
a)1 == “ 1 “
a)1 == [1]
f) null == undefined
f) 1 == 1
f) “ “ == false
f) NaN == NaN
f) 1 == “true”
Prefer strict equals === to ==
QUNIT
SCOPE
A/
(function () {
if (true) {
var functionScope = "functionScope";
}
return functionScope;
})();
B/
var functionScope = "functionScope";
(function () {
return functionScope;
})();
C/
(function () {
var test = function () {
var functionScope = "functionScope";
}
return functionScope;
})();
D/
(function () {
var functionScope = 0;
var functionScope = “functionScope”;
return function
}
HOISTING
http://elegantcode.com/2010/12/24/basic-javascript-part-5-hoisting/
Function scope means that all
variables and parameters
declared inside a function are
visible everywhere within the
function.
FUNCTION DECLARATIONS
VS FUNCTION EXPRESSIONS
Function Declaration
function functionDeclaration() {
return “I’m a function declaration”;
}
Function Expression
var functionExpression = function() {
return “I’m a function expression”;
};
AUTOMATIC SEMICOLON
INSERTION
Using semicolons in JavaScript is optional BUT
JavaScript inserts them automatically.
Don't forget to use new on constructor functions.
New and This
TECHNIQUES
• Constructor protection
• Encapsulation
• Placing methods on the prototype
• Self executing functions
• Namespaces
• Module Pattern / Revealing module pattern
CONSTRUCTOR PROTECTION
STORE FUNCTIONS ON THE
PROTOTYPE
HADI HARIRI
• “It’s just JavaScript!”
• “JavaScript is write once code – you never want to go back to
it and change it”
• “People think that JavaScript is not maintainable.”
• “People think SRP doesn’t exist in JavaScript – how can a class
have a single responsibility if there isn’t a class”
• “We care in C#, we care in Java....why not JavaScript?”
NEXT STEPS
• Know JavaScript better.
• Be able to write and run tests easily in Visual
Studio.
• Write real world JavaScript tests with
mocking.
• Get intellisense in Visual Studio
• Be able to run tests as part of Team City build
• Have tools which will help me improve the
USEFUL LINKS
• K Scott Allen’s blog - www.odetocode.com/blogs/all
• Hadi Hariri , same talk in Norway – http://vimeo.com/43536490
• Basic JavaScript blog posts – http://elegantcode.com/2011/03/24/basic-
javascript-part-12-function-hoisting
• JavaScript sketch pad – http://jsfiddle.net
• Free Book (now published by O’Reilly) based on ECMAScript version 3
http://javascriptenlightment.com/JavaScript_Enlightenment.pdf
• JavaScript performance test bed – http://jsperf.com

More Related Content

What's hot (20)

PDF
JavaScript Programming
Sehwan Noh
 
PDF
JavaScript - Chapter 11 - Events
WebStackAcademy
 
PPT
JavaScript Tutorial
Bui Kiet
 
PPTX
Javascript 101
Shlomi Komemi
 
PPTX
Introduction to php
shanmukhareddy dasi
 
PPTX
Java script
Shyam Khant
 
PDF
ReactJS presentation
Thanh Tuong
 
PPTX
Advance Java Topics (J2EE)
slire
 
PDF
Php Tutorials for Beginners
Vineet Kumar Saini
 
PPTX
Java program structure
shalinikarunakaran1
 
PPTX
Intro to React
Justin Reock
 
PDF
An introduction to React.js
Emanuele DelBono
 
PPT
Java Script ppt
Priya Goyal
 
PPTX
ReactJS presentation.pptx
DivyanshGupta922023
 
PPTX
Ajax presentation
Bharat_Kumawat
 
PPTX
JSON: The Basics
Jeff Fox
 
PPT
Javascript
guest03a6e6
 
PPTX
Java Programming
Elizabeth alexander
 
PDF
JavaScript Promises
Derek Willian Stavis
 
JavaScript Programming
Sehwan Noh
 
JavaScript - Chapter 11 - Events
WebStackAcademy
 
JavaScript Tutorial
Bui Kiet
 
Javascript 101
Shlomi Komemi
 
Introduction to php
shanmukhareddy dasi
 
Java script
Shyam Khant
 
ReactJS presentation
Thanh Tuong
 
Advance Java Topics (J2EE)
slire
 
Php Tutorials for Beginners
Vineet Kumar Saini
 
Java program structure
shalinikarunakaran1
 
Intro to React
Justin Reock
 
An introduction to React.js
Emanuele DelBono
 
Java Script ppt
Priya Goyal
 
ReactJS presentation.pptx
DivyanshGupta922023
 
Ajax presentation
Bharat_Kumawat
 
JSON: The Basics
Jeff Fox
 
Javascript
guest03a6e6
 
Java Programming
Elizabeth alexander
 
JavaScript Promises
Derek Willian Stavis
 

Viewers also liked (14)

PPT
Js ppt
Rakhi Thota
 
PPTX
Presentation on C++ Programming Language
satvirsandhu9
 
PPTX
Js coding standards
simonKenyonShepard
 
PPTX
Software development best practices & coding guidelines
Ankur Goyal
 
PDF
jQuery for beginners
Arulmurugan Rajaraman
 
PPTX
Dhtml
rahul kundu
 
PPS
Xhtml
Samir Sabry
 
PDF
Introduction to XHTML
Hend Al-Khalifa
 
PPTX
Dhtml
Sadhana28
 
PPT
Dynamic HTML
Vinil Patel
 
PPTX
Dynamic HTML (DHTML)
Himanshu Kumar
 
PPTX
C++ ppt
parpan34
 
Js ppt
Rakhi Thota
 
Presentation on C++ Programming Language
satvirsandhu9
 
Js coding standards
simonKenyonShepard
 
Software development best practices & coding guidelines
Ankur Goyal
 
jQuery for beginners
Arulmurugan Rajaraman
 
Introduction to XHTML
Hend Al-Khalifa
 
Dhtml
Sadhana28
 
Dynamic HTML
Vinil Patel
 
Dynamic HTML (DHTML)
Himanshu Kumar
 
C++ ppt
parpan34
 
Ad

Similar to Java script ppt (20)

PPTX
LinkedIn TBC JavaScript 100: Intro
Adam Crabtree
 
PPTX
Javascript basics
Solv AS
 
PPTX
All of javascript
Togakangaroo
 
PPTX
JavaScript Fundamentals & JQuery
Jamshid Hashimi
 
PPTX
All of Javascript
Togakangaroo
 
PDF
JavaScript Core
François Sarradin
 
PPTX
Awesomeness of JavaScript…almost
Quinton Sheppard
 
PPTX
Javascript
Prashant Kumar
 
KEY
JavaScript Neednt Hurt - JavaBin talk
Thomas Kjeldahl Nilsson
 
PPTX
Javascript for the c# developer
Salvatore Fazio
 
PPT
JavaScript Workshop
Pamela Fox
 
PDF
The JavaScript You Wished You Knew
Troy Miles
 
PDF
Scalable JavaScript
Ynon Perek
 
ODP
jsbasics-slide
Peter Borkuti
 
PPT
Java Script
Sarvan15
 
PDF
Java Script
Sarvan15
 
PPTX
Javascripts. pptt
RaviShankarSinghal
 
PPT
JavaScript ppt for introduction of javascripta
nehatanveer5765
 
PPTX
Java script
Sukrit Gupta
 
PPT
Presentation JavaScript Introduction Data Types Variables Control Structure
SripathiRavi1
 
LinkedIn TBC JavaScript 100: Intro
Adam Crabtree
 
Javascript basics
Solv AS
 
All of javascript
Togakangaroo
 
JavaScript Fundamentals & JQuery
Jamshid Hashimi
 
All of Javascript
Togakangaroo
 
JavaScript Core
François Sarradin
 
Awesomeness of JavaScript…almost
Quinton Sheppard
 
Javascript
Prashant Kumar
 
JavaScript Neednt Hurt - JavaBin talk
Thomas Kjeldahl Nilsson
 
Javascript for the c# developer
Salvatore Fazio
 
JavaScript Workshop
Pamela Fox
 
The JavaScript You Wished You Knew
Troy Miles
 
Scalable JavaScript
Ynon Perek
 
jsbasics-slide
Peter Borkuti
 
Java Script
Sarvan15
 
Java Script
Sarvan15
 
Javascripts. pptt
RaviShankarSinghal
 
JavaScript ppt for introduction of javascripta
nehatanveer5765
 
Java script
Sukrit Gupta
 
Presentation JavaScript Introduction Data Types Variables Control Structure
SripathiRavi1
 
Ad

More from The Health and Social Care Information Centre (20)

PPSX
Hscic data quality_data_standards_workshop_taunton_2016
The Health and Social Care Information Centre
 
PPSX
Hscic data quality_data_standards_workshop_manchester_2016
The Health and Social Care Information Centre
 
PPSX
Hscic data quality_data_standards_workshop_leeds_2016
The Health and Social Care Information Centre
 
PDF
Benefits case study summary – prescriptions dispensed in the community’ publi...
The Health and Social Care Information Centre
 
PDF
Benefits case study summary: NHS Immunisation Statistics Publication
The Health and Social Care Information Centre
 
PDF
Benefits case study: NHS Immunisation Statistics Publication
The Health and Social Care Information Centre
 
PDF
Benefits case study summary: Diabetes Uk Putting Feet First Campaign
The Health and Social Care Information Centre
 
PDF
Benefits case study: Diabetes UK Putting Feet First Campaign
The Health and Social Care Information Centre
 
PPTX
HSCIC/ESR Data Quality / Data Standards Road Shows 2015/16
The Health and Social Care Information Centre
 
PPTX
Nicholas Oughtibridge: Code Of Practice For Confidential Information Commissi...
The Health and Social Care Information Centre
 
PPT
Julie Henderson and Shaun Rowark (NICE): Commissioning in Healthcare show (Ci...
The Health and Social Care Information Centre
 
PPTX
Jackie Shears: NHS Pathways Commissioning in Healthcare show (CiH 2015)
The Health and Social Care Information Centre
 
PPTX
Andy Williams: Healthcare Efficiency Through Technology Expo (HETT 2015)
The Health and Social Care Information Centre
 
PPTX
Cleveland Henry: Healthcare Efficiency Through Technology Expo (HETT 2015)
The Health and Social Care Information Centre
 
PDF
Measures from the Adult Social Care Outcomes Framework, England - 2014-15
The Health and Social Care Information Centre
 
PPTX
HSCIC/ESR Data Quality / Data Standards Road Shows 2015/16
The Health and Social Care Information Centre
 
PDF
Stoptober: infographic of HSCIC statistics on smoking
The Health and Social Care Information Centre
 
PDF
Focus on the health and care of young people - poster
The Health and Social Care Information Centre
 
PPTX
Focus on the health and care of young people
The Health and Social Care Information Centre
 
PDF
Business plan for the Health and Social Care Information Centre 2015 - 2016
The Health and Social Care Information Centre
 
Hscic data quality_data_standards_workshop_taunton_2016
The Health and Social Care Information Centre
 
Hscic data quality_data_standards_workshop_manchester_2016
The Health and Social Care Information Centre
 
Hscic data quality_data_standards_workshop_leeds_2016
The Health and Social Care Information Centre
 
Benefits case study summary – prescriptions dispensed in the community’ publi...
The Health and Social Care Information Centre
 
Benefits case study summary: NHS Immunisation Statistics Publication
The Health and Social Care Information Centre
 
Benefits case study: NHS Immunisation Statistics Publication
The Health and Social Care Information Centre
 
Benefits case study summary: Diabetes Uk Putting Feet First Campaign
The Health and Social Care Information Centre
 
Benefits case study: Diabetes UK Putting Feet First Campaign
The Health and Social Care Information Centre
 
HSCIC/ESR Data Quality / Data Standards Road Shows 2015/16
The Health and Social Care Information Centre
 
Nicholas Oughtibridge: Code Of Practice For Confidential Information Commissi...
The Health and Social Care Information Centre
 
Julie Henderson and Shaun Rowark (NICE): Commissioning in Healthcare show (Ci...
The Health and Social Care Information Centre
 
Jackie Shears: NHS Pathways Commissioning in Healthcare show (CiH 2015)
The Health and Social Care Information Centre
 
Andy Williams: Healthcare Efficiency Through Technology Expo (HETT 2015)
The Health and Social Care Information Centre
 
Cleveland Henry: Healthcare Efficiency Through Technology Expo (HETT 2015)
The Health and Social Care Information Centre
 
Measures from the Adult Social Care Outcomes Framework, England - 2014-15
The Health and Social Care Information Centre
 
HSCIC/ESR Data Quality / Data Standards Road Shows 2015/16
The Health and Social Care Information Centre
 
Stoptober: infographic of HSCIC statistics on smoking
The Health and Social Care Information Centre
 
Focus on the health and care of young people - poster
The Health and Social Care Information Centre
 
Focus on the health and care of young people
The Health and Social Care Information Centre
 
Business plan for the Health and Social Care Information Centre 2015 - 2016
The Health and Social Care Information Centre
 

Recently uploaded (20)

PDF
BERITA TERBARU HOYE55 LOGIN LINK ALTERNARTIF SLOT88 GACOR 2025
hoye55
 
PPT
When You Are Not an HIV Specialist But You Are Addressing Broader Healthcare ...
PeerVoice
 
PDF
MSTG 6th Edition Updated October 2024 CC.pdf
casumulupatrickcom
 
PDF
Patient with Cirrhotic Liver – Pathophysiology, Clinical Manifestations, and ...
PKLI-Institute of Nursing and Allied Health Sciences Lahore , Pakistan.
 
PDF
First Stage of ED Therapy Best Sexologist in Patna Bihar Dr. Sunil Dubey
Sexologist Dr. Sunil Dubey - Dubey Clinic
 
PPT
Catalysts for Redefined Care in Colorectal Cancer: Adapting Systemic Therapy ...
PVI, PeerView Institute for Medical Education
 
PPTX
INVESTIGATIONS FOR BREAST DISEASES.pptx
Padmaraju Dhanaraju
 
PDF
MEDULLA OBLONGATA - Prof.Dr.N.Mugunthan. KMMC.pdf
Kanyakumari Medical Mission Research Center, Muttom
 
PPT
ALL-in on Bispecific Innovation: Guidance on the Present and Future of Off-th...
PVI, PeerView Institute for Medical Education
 
PDF
Clinical trial protocol development Seminar.pdf
siddhikalbande
 
PPTX
ZINC DEFICIENCY (HYPOZINCEMIA) in Animals
Dr-Haseeb Zubair Tagar
 
PDF
REVISED SCHEDULE M EFFECTIVE FROM DEC.2025.pdf
DR.S.K. RAI
 
PPTX
Heavy Metal Poisoning (Lead, Mercury, Arsenic)pptx
Dr. Sarita Sharma
 
PPT
Navigating Multifactorial Clinical Decisions in HR+ EBC and MBC: A Case-Based...
PVI, PeerView Institute for Medical Education
 
PPTX
SURGICAL INSTRUMENTS for health care students .pptx
DrSuwarnaChaudhary
 
PPTX
Roganutpadaniya Adhyaya by Dr Harish M H- Consultant and Assistant professor ...
Dr Harish M Hadapad
 
PDF
ANATOMY OF SPINAL CORD-Prof.Dr.N.Mugunthan KMMC
Kanyakumari Medical Mission Research Center, Muttom
 
PDF
Clinical studies & observational trials in the age of AI
Paul Agapow
 
PPTX
Neuroblastoma & Ganglioneuroblastoma management.pptx
NEIGRIHMS, SHILLONG
 
PPTX
Containers, Closures for Pharmaceuticals.pptx
Unmesh Wankhade
 
BERITA TERBARU HOYE55 LOGIN LINK ALTERNARTIF SLOT88 GACOR 2025
hoye55
 
When You Are Not an HIV Specialist But You Are Addressing Broader Healthcare ...
PeerVoice
 
MSTG 6th Edition Updated October 2024 CC.pdf
casumulupatrickcom
 
Patient with Cirrhotic Liver – Pathophysiology, Clinical Manifestations, and ...
PKLI-Institute of Nursing and Allied Health Sciences Lahore , Pakistan.
 
First Stage of ED Therapy Best Sexologist in Patna Bihar Dr. Sunil Dubey
Sexologist Dr. Sunil Dubey - Dubey Clinic
 
Catalysts for Redefined Care in Colorectal Cancer: Adapting Systemic Therapy ...
PVI, PeerView Institute for Medical Education
 
INVESTIGATIONS FOR BREAST DISEASES.pptx
Padmaraju Dhanaraju
 
MEDULLA OBLONGATA - Prof.Dr.N.Mugunthan. KMMC.pdf
Kanyakumari Medical Mission Research Center, Muttom
 
ALL-in on Bispecific Innovation: Guidance on the Present and Future of Off-th...
PVI, PeerView Institute for Medical Education
 
Clinical trial protocol development Seminar.pdf
siddhikalbande
 
ZINC DEFICIENCY (HYPOZINCEMIA) in Animals
Dr-Haseeb Zubair Tagar
 
REVISED SCHEDULE M EFFECTIVE FROM DEC.2025.pdf
DR.S.K. RAI
 
Heavy Metal Poisoning (Lead, Mercury, Arsenic)pptx
Dr. Sarita Sharma
 
Navigating Multifactorial Clinical Decisions in HR+ EBC and MBC: A Case-Based...
PVI, PeerView Institute for Medical Education
 
SURGICAL INSTRUMENTS for health care students .pptx
DrSuwarnaChaudhary
 
Roganutpadaniya Adhyaya by Dr Harish M H- Consultant and Assistant professor ...
Dr Harish M Hadapad
 
ANATOMY OF SPINAL CORD-Prof.Dr.N.Mugunthan KMMC
Kanyakumari Medical Mission Research Center, Muttom
 
Clinical studies & observational trials in the age of AI
Paul Agapow
 
Neuroblastoma & Ganglioneuroblastoma management.pptx
NEIGRIHMS, SHILLONG
 
Containers, Closures for Pharmaceuticals.pptx
Unmesh Wankhade
 

Java script ppt

  • 1. JAVASCRIPT DOJO Lessons and thoughts from DevWeek
  • 2. TALKS ATTENDED • “Modern JavaScript” - K. Scott Allen • “Just because it’s JavaScript doesn’t give you the right to write rubbish!” – Hadi Hariri • Mobile development with MVC4 and jQuery Mobile – Brock Allen
  • 4. DOUBLE AND TRIPLE EQUALS a)1 == “1” a)1 == true a)“1” == true a)1 == “ 1 “ a)1 == [1] f) null == undefined f) 1 == 1 f) “ “ == false f) NaN == NaN f) 1 == “true”
  • 7. SCOPE A/ (function () { if (true) { var functionScope = "functionScope"; } return functionScope; })(); B/ var functionScope = "functionScope"; (function () { return functionScope; })(); C/ (function () { var test = function () { var functionScope = "functionScope"; } return functionScope; })(); D/ (function () { var functionScope = 0; var functionScope = “functionScope”; return function }
  • 9. Function scope means that all variables and parameters declared inside a function are visible everywhere within the function.
  • 10. FUNCTION DECLARATIONS VS FUNCTION EXPRESSIONS Function Declaration function functionDeclaration() { return “I’m a function declaration”; } Function Expression var functionExpression = function() { return “I’m a function expression”; };
  • 11. AUTOMATIC SEMICOLON INSERTION Using semicolons in JavaScript is optional BUT JavaScript inserts them automatically. Don't forget to use new on constructor functions. New and This
  • 12. TECHNIQUES • Constructor protection • Encapsulation • Placing methods on the prototype • Self executing functions • Namespaces • Module Pattern / Revealing module pattern
  • 14. STORE FUNCTIONS ON THE PROTOTYPE
  • 15. HADI HARIRI • “It’s just JavaScript!” • “JavaScript is write once code – you never want to go back to it and change it” • “People think that JavaScript is not maintainable.” • “People think SRP doesn’t exist in JavaScript – how can a class have a single responsibility if there isn’t a class” • “We care in C#, we care in Java....why not JavaScript?”
  • 16. NEXT STEPS • Know JavaScript better. • Be able to write and run tests easily in Visual Studio. • Write real world JavaScript tests with mocking. • Get intellisense in Visual Studio • Be able to run tests as part of Team City build • Have tools which will help me improve the
  • 17. USEFUL LINKS • K Scott Allen’s blog - www.odetocode.com/blogs/all • Hadi Hariri , same talk in Norway – http://vimeo.com/43536490 • Basic JavaScript blog posts – http://elegantcode.com/2011/03/24/basic- javascript-part-12-function-hoisting • JavaScript sketch pad – http://jsfiddle.net • Free Book (now published by O’Reilly) based on ECMAScript version 3 http://javascriptenlightment.com/JavaScript_Enlightenment.pdf • JavaScript performance test bed – http://jsperf.com