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)

Php and MySQL
Php and MySQLPhp and MySQL
Php and MySQL
Tiji Thomas
 
Php mysql ppt
Php mysql pptPhp mysql ppt
Php mysql ppt
Karmatechnologies Pvt. Ltd.
 
Javascript
JavascriptJavascript
Javascript
Momentum Design Lab
 
JavaScript - Chapter 12 - Document Object Model
  JavaScript - Chapter 12 - Document Object Model  JavaScript - Chapter 12 - Document Object Model
JavaScript - Chapter 12 - Document Object Model
WebStackAcademy
 
ES6 presentation
ES6 presentationES6 presentation
ES6 presentation
ritika1
 
Introduction to JavaScript
Introduction to JavaScriptIntroduction to JavaScript
Introduction to JavaScript
Andres Baravalle
 
TypeScript - An Introduction
TypeScript - An IntroductionTypeScript - An Introduction
TypeScript - An Introduction
NexThoughts Technologies
 
Python Flask Tutorial For Beginners | Flask Web Development Tutorial | Python...
Python Flask Tutorial For Beginners | Flask Web Development Tutorial | Python...Python Flask Tutorial For Beginners | Flask Web Development Tutorial | Python...
Python Flask Tutorial For Beginners | Flask Web Development Tutorial | Python...
Edureka!
 
Java script errors & exceptions handling
Java script  errors & exceptions handlingJava script  errors & exceptions handling
Java script errors & exceptions handling
AbhishekMondal42
 
JavaScript Tutorial For Beginners | JavaScript Training | JavaScript Programm...
JavaScript Tutorial For Beginners | JavaScript Training | JavaScript Programm...JavaScript Tutorial For Beginners | JavaScript Training | JavaScript Programm...
JavaScript Tutorial For Beginners | JavaScript Training | JavaScript Programm...
Edureka!
 
Java script
Java scriptJava script
Java script
Shyam Khant
 
Javascript
JavascriptJavascript
Javascript
mussawir20
 
Std 12 computer chapter 6 object oriented concepts (part 1)
Std 12 computer chapter 6 object oriented concepts (part 1)Std 12 computer chapter 6 object oriented concepts (part 1)
Std 12 computer chapter 6 object oriented concepts (part 1)
Nuzhat Memon
 
ASP.NET Page Life Cycle
ASP.NET Page Life CycleASP.NET Page Life Cycle
ASP.NET Page Life Cycle
Abhishek Sur
 
jQuery - Chapter 3 - Effects
jQuery - Chapter 3 - Effects  jQuery - Chapter 3 - Effects
jQuery - Chapter 3 - Effects
WebStackAcademy
 
C# Basics
C# BasicsC# Basics
C# Basics
Sunil OS
 
jQuery
jQueryjQuery
jQuery
Mostafa Bayomi
 
Spring Boot and REST API
Spring Boot and REST APISpring Boot and REST API
Spring Boot and REST API
07.pallav
 
jQuery
jQueryjQuery
jQuery
Jay Poojara
 
JavaScript: Variables and Functions
JavaScript: Variables and FunctionsJavaScript: Variables and Functions
JavaScript: Variables and Functions
Jussi Pohjolainen
 
JavaScript - Chapter 12 - Document Object Model
  JavaScript - Chapter 12 - Document Object Model  JavaScript - Chapter 12 - Document Object Model
JavaScript - Chapter 12 - Document Object Model
WebStackAcademy
 
ES6 presentation
ES6 presentationES6 presentation
ES6 presentation
ritika1
 
Introduction to JavaScript
Introduction to JavaScriptIntroduction to JavaScript
Introduction to JavaScript
Andres Baravalle
 
Python Flask Tutorial For Beginners | Flask Web Development Tutorial | Python...
Python Flask Tutorial For Beginners | Flask Web Development Tutorial | Python...Python Flask Tutorial For Beginners | Flask Web Development Tutorial | Python...
Python Flask Tutorial For Beginners | Flask Web Development Tutorial | Python...
Edureka!
 
Java script errors & exceptions handling
Java script  errors & exceptions handlingJava script  errors & exceptions handling
Java script errors & exceptions handling
AbhishekMondal42
 
JavaScript Tutorial For Beginners | JavaScript Training | JavaScript Programm...
JavaScript Tutorial For Beginners | JavaScript Training | JavaScript Programm...JavaScript Tutorial For Beginners | JavaScript Training | JavaScript Programm...
JavaScript Tutorial For Beginners | JavaScript Training | JavaScript Programm...
Edureka!
 
Std 12 computer chapter 6 object oriented concepts (part 1)
Std 12 computer chapter 6 object oriented concepts (part 1)Std 12 computer chapter 6 object oriented concepts (part 1)
Std 12 computer chapter 6 object oriented concepts (part 1)
Nuzhat Memon
 
ASP.NET Page Life Cycle
ASP.NET Page Life CycleASP.NET Page Life Cycle
ASP.NET Page Life Cycle
Abhishek Sur
 
jQuery - Chapter 3 - Effects
jQuery - Chapter 3 - Effects  jQuery - Chapter 3 - Effects
jQuery - Chapter 3 - Effects
WebStackAcademy
 
Spring Boot and REST API
Spring Boot and REST APISpring Boot and REST API
Spring Boot and REST API
07.pallav
 
JavaScript: Variables and Functions
JavaScript: Variables and FunctionsJavaScript: Variables and Functions
JavaScript: Variables and Functions
Jussi Pohjolainen
 

Viewers also liked (15)

Presentation on C++ Programming Language
Presentation on C++ Programming LanguagePresentation on C++ Programming Language
Presentation on C++ Programming Language
satvirsandhu9
 
Js coding standards
Js coding standardsJs coding standards
Js coding standards
simonKenyonShepard
 
Software development best practices & coding guidelines
Software development best practices & coding guidelinesSoftware development best practices & coding guidelines
Software development best practices & coding guidelines
Ankur Goyal
 
jQuery for beginners
jQuery for beginnersjQuery for beginners
jQuery for beginners
Arulmurugan Rajaraman
 
JavaScript - An Introduction
JavaScript - An IntroductionJavaScript - An Introduction
JavaScript - An Introduction
Manvendra Singh
 
Dhtml
DhtmlDhtml
Dhtml
rahul kundu
 
Xhtml
XhtmlXhtml
Xhtml
Samir Sabry
 
XHTML
XHTMLXHTML
XHTML
Jussi Pohjolainen
 
Introduction to XHTML
Introduction to XHTMLIntroduction to XHTML
Introduction to XHTML
Hend Al-Khalifa
 
Dhtml
DhtmlDhtml
Dhtml
Sadhana28
 
Dynamic HTML
Dynamic HTMLDynamic HTML
Dynamic HTML
Vinil Patel
 
JSON: The Basics
JSON: The BasicsJSON: The Basics
JSON: The Basics
Jeff Fox
 
Dynamic HTML (DHTML)
Dynamic HTML (DHTML)Dynamic HTML (DHTML)
Dynamic HTML (DHTML)
Himanshu Kumar
 
C++ ppt
C++ pptC++ ppt
C++ ppt
parpan34
 
Json
JsonJson
Json
Anand Kumar Rajana
 
Ad

Similar to Java script ppt (20)

LinkedIn TBC JavaScript 100: Intro
LinkedIn TBC JavaScript 100: IntroLinkedIn TBC JavaScript 100: Intro
LinkedIn TBC JavaScript 100: Intro
Adam Crabtree
 
Javascript basics
Javascript basicsJavascript basics
Javascript basics
Solv AS
 
All of javascript
All of javascriptAll of javascript
All of javascript
Togakangaroo
 
JavaScript Fundamentals & JQuery
JavaScript Fundamentals & JQueryJavaScript Fundamentals & JQuery
JavaScript Fundamentals & JQuery
Jamshid Hashimi
 
All of Javascript
All of JavascriptAll of Javascript
All of Javascript
Togakangaroo
 
JavaScript Core
JavaScript CoreJavaScript Core
JavaScript Core
François Sarradin
 
Awesomeness of JavaScript…almost
Awesomeness of JavaScript…almostAwesomeness of JavaScript…almost
Awesomeness of JavaScript…almost
Quinton Sheppard
 
Javascript
JavascriptJavascript
Javascript
Prashant Kumar
 
JavaScript Neednt Hurt - JavaBin talk
JavaScript Neednt Hurt - JavaBin talkJavaScript Neednt Hurt - JavaBin talk
JavaScript Neednt Hurt - JavaBin talk
Thomas Kjeldahl Nilsson
 
Javascript for the c# developer
Javascript for the c# developerJavascript for the c# developer
Javascript for the c# developer
Salvatore Fazio
 
JavaScript Workshop
JavaScript WorkshopJavaScript Workshop
JavaScript Workshop
Pamela Fox
 
The JavaScript You Wished You Knew
The JavaScript You Wished You KnewThe JavaScript You Wished You Knew
The JavaScript You Wished You Knew
Troy Miles
 
Scalable JavaScript
Scalable JavaScriptScalable JavaScript
Scalable JavaScript
Ynon Perek
 
jsbasics-slide
jsbasics-slidejsbasics-slide
jsbasics-slide
Peter Borkuti
 
Java Script
Java ScriptJava Script
Java Script
Sarvan15
 
Java Script
Java ScriptJava Script
Java Script
Sarvan15
 
Javascripts. pptt
Javascripts. ppttJavascripts. pptt
Javascripts. pptt
RaviShankarSinghal
 
JavaScript ppt for introduction of javascripta
JavaScript ppt for introduction of javascriptaJavaScript ppt for introduction of javascripta
JavaScript ppt for introduction of javascripta
nehatanveer5765
 
JavaScript Tutorial
JavaScript  TutorialJavaScript  Tutorial
JavaScript Tutorial
Bui Kiet
 
Java script
Java scriptJava script
Java script
Sukrit Gupta
 
LinkedIn TBC JavaScript 100: Intro
LinkedIn TBC JavaScript 100: IntroLinkedIn TBC JavaScript 100: Intro
LinkedIn TBC JavaScript 100: Intro
Adam Crabtree
 
Javascript basics
Javascript basicsJavascript basics
Javascript basics
Solv AS
 
JavaScript Fundamentals & JQuery
JavaScript Fundamentals & JQueryJavaScript Fundamentals & JQuery
JavaScript Fundamentals & JQuery
Jamshid Hashimi
 
Awesomeness of JavaScript…almost
Awesomeness of JavaScript…almostAwesomeness of JavaScript…almost
Awesomeness of JavaScript…almost
Quinton Sheppard
 
Javascript for the c# developer
Javascript for the c# developerJavascript for the c# developer
Javascript for the c# developer
Salvatore Fazio
 
JavaScript Workshop
JavaScript WorkshopJavaScript Workshop
JavaScript Workshop
Pamela Fox
 
The JavaScript You Wished You Knew
The JavaScript You Wished You KnewThe JavaScript You Wished You Knew
The JavaScript You Wished You Knew
Troy Miles
 
Scalable JavaScript
Scalable JavaScriptScalable JavaScript
Scalable JavaScript
Ynon Perek
 
Java Script
Java ScriptJava Script
Java Script
Sarvan15
 
Java Script
Java ScriptJava Script
Java Script
Sarvan15
 
JavaScript ppt for introduction of javascripta
JavaScript ppt for introduction of javascriptaJavaScript ppt for introduction of javascripta
JavaScript ppt for introduction of javascripta
nehatanveer5765
 
JavaScript Tutorial
JavaScript  TutorialJavaScript  Tutorial
JavaScript Tutorial
Bui Kiet
 
Ad

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

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

Recently uploaded (20)

Palliative Care for Patients with Heart Failure
Palliative Care for Patients with Heart FailurePalliative Care for Patients with Heart Failure
Palliative Care for Patients with Heart Failure
Duke Heart
 
When is the Right Time to Refer to (Advanced) Heart Failure?
When is the Right Time to Refer to (Advanced) Heart Failure?When is the Right Time to Refer to (Advanced) Heart Failure?
When is the Right Time to Refer to (Advanced) Heart Failure?
Duke Heart
 
Treatment for HFpEF: Current State of the Art and Ongoing Trials
Treatment for HFpEF: Current State of the Art and Ongoing TrialsTreatment for HFpEF: Current State of the Art and Ongoing Trials
Treatment for HFpEF: Current State of the Art and Ongoing Trials
Duke Heart
 
Evolution of Diagnostic and Treatment Options in ATTR Cardiac Amyloidosis
Evolution of Diagnostic and Treatment Options in ATTR Cardiac AmyloidosisEvolution of Diagnostic and Treatment Options in ATTR Cardiac Amyloidosis
Evolution of Diagnostic and Treatment Options in ATTR Cardiac Amyloidosis
Duke Heart
 
cryptococcus.pptxcryptococcus.pptxcryptococcus.pptx
cryptococcus.pptxcryptococcus.pptxcryptococcus.pptxcryptococcus.pptxcryptococcus.pptxcryptococcus.pptx
cryptococcus.pptxcryptococcus.pptxcryptococcus.pptx
VaisHali822687
 
Peripheral Retinal Degenerations. pptxxx
Peripheral Retinal Degenerations. pptxxxPeripheral Retinal Degenerations. pptxxx
Peripheral Retinal Degenerations. pptxxx
Dr. Geetika Singh
 
DRUGS USED IN UTI OR URINARY ANTISEPTICS
DRUGS USED IN UTI OR URINARY ANTISEPTICSDRUGS USED IN UTI OR URINARY ANTISEPTICS
DRUGS USED IN UTI OR URINARY ANTISEPTICS
Umanath Singh Autonomous State Medical College, Jaunpur
 
Interstitial brachytherapy in Ca CERVIX.pptx
Interstitial brachytherapy in Ca CERVIX.pptxInterstitial brachytherapy in Ca CERVIX.pptx
Interstitial brachytherapy in Ca CERVIX.pptx
Brijesh Maheshwari
 
JAUNDICE,BIOCHEMISTRY, FIRST MBBS STUDENTS
JAUNDICE,BIOCHEMISTRY, FIRST MBBS STUDENTSJAUNDICE,BIOCHEMISTRY, FIRST MBBS STUDENTS
JAUNDICE,BIOCHEMISTRY, FIRST MBBS STUDENTS
amitarathore081986
 
Advances in Novel Drug Therapy for Metabolic Dysfunction-associated Steatohep...
Advances in Novel Drug Therapy for Metabolic Dysfunction-associated Steatohep...Advances in Novel Drug Therapy for Metabolic Dysfunction-associated Steatohep...
Advances in Novel Drug Therapy for Metabolic Dysfunction-associated Steatohep...
syedanasir5
 
ADRENERGIC SYSTEM AND RELATED DRUGS LIKE ADRENALINE
ADRENERGIC SYSTEM AND RELATED DRUGS LIKE ADRENALINEADRENERGIC SYSTEM AND RELATED DRUGS LIKE ADRENALINE
ADRENERGIC SYSTEM AND RELATED DRUGS LIKE ADRENALINE
Umanath Singh Autonomous State Medical College, Jaunpur
 
Indian Childhood Cirrhosis nn.pptx ICC PEDIA
Indian Childhood Cirrhosis nn.pptx ICC PEDIAIndian Childhood Cirrhosis nn.pptx ICC PEDIA
Indian Childhood Cirrhosis nn.pptx ICC PEDIA
Pooja Rani
 
NURSING REVISION NOTES 2 PATHO II UP.pptx
NURSING REVISION NOTES  2 PATHO II UP.pptxNURSING REVISION NOTES  2 PATHO II UP.pptx
NURSING REVISION NOTES 2 PATHO II UP.pptx
cherryhonours
 
Anaphylaxis Comprehensive Clinical Overview
Anaphylaxis Comprehensive Clinical OverviewAnaphylaxis Comprehensive Clinical Overview
Anaphylaxis Comprehensive Clinical Overview
Dr. BISHAL SAPKOTA
 
Hepatocellular carcinoma: From diagnosis to emerging therapeutics
Hepatocellular carcinoma: From diagnosis to emerging therapeuticsHepatocellular carcinoma: From diagnosis to emerging therapeutics
Hepatocellular carcinoma: From diagnosis to emerging therapeutics
ajayyadav753
 
COMMUNITY Bdcfgvbjhnkml;,lfgbjhmlASED HEALTH CARE I.pptx
COMMUNITY Bdcfgvbjhnkml;,lfgbjhmlASED HEALTH CARE I.pptxCOMMUNITY Bdcfgvbjhnkml;,lfgbjhmlASED HEALTH CARE I.pptx
COMMUNITY Bdcfgvbjhnkml;,lfgbjhmlASED HEALTH CARE I.pptx
FREDRICK CIIRA
 
REFRAMING OF EXPERTISE AND INFORMATION IN HEALTH
REFRAMING OF EXPERTISE AND INFORMATION IN HEALTHREFRAMING OF EXPERTISE AND INFORMATION IN HEALTH
REFRAMING OF EXPERTISE AND INFORMATION IN HEALTH
Tina Purnat
 
Navigating Advances in Alzheimer’s Disease: Practical Strategies for Integrat...
Navigating Advances in Alzheimer’s Disease: Practical Strategies for Integrat...Navigating Advances in Alzheimer’s Disease: Practical Strategies for Integrat...
Navigating Advances in Alzheimer’s Disease: Practical Strategies for Integrat...
PVI, PeerView Institute for Medical Education
 
THE EYELID PPT FOR 1ST YEAR BSC OPTOMETRY
THE EYELID PPT FOR 1ST YEAR BSC OPTOMETRYTHE EYELID PPT FOR 1ST YEAR BSC OPTOMETRY
THE EYELID PPT FOR 1ST YEAR BSC OPTOMETRY
nihalanichz
 
Respiratory system harrison textbook part 1.docx
Respiratory system harrison textbook part 1.docxRespiratory system harrison textbook part 1.docx
Respiratory system harrison textbook part 1.docx
Haneen Hassan
 
Palliative Care for Patients with Heart Failure
Palliative Care for Patients with Heart FailurePalliative Care for Patients with Heart Failure
Palliative Care for Patients with Heart Failure
Duke Heart
 
When is the Right Time to Refer to (Advanced) Heart Failure?
When is the Right Time to Refer to (Advanced) Heart Failure?When is the Right Time to Refer to (Advanced) Heart Failure?
When is the Right Time to Refer to (Advanced) Heart Failure?
Duke Heart
 
Treatment for HFpEF: Current State of the Art and Ongoing Trials
Treatment for HFpEF: Current State of the Art and Ongoing TrialsTreatment for HFpEF: Current State of the Art and Ongoing Trials
Treatment for HFpEF: Current State of the Art and Ongoing Trials
Duke Heart
 
Evolution of Diagnostic and Treatment Options in ATTR Cardiac Amyloidosis
Evolution of Diagnostic and Treatment Options in ATTR Cardiac AmyloidosisEvolution of Diagnostic and Treatment Options in ATTR Cardiac Amyloidosis
Evolution of Diagnostic and Treatment Options in ATTR Cardiac Amyloidosis
Duke Heart
 
cryptococcus.pptxcryptococcus.pptxcryptococcus.pptx
cryptococcus.pptxcryptococcus.pptxcryptococcus.pptxcryptococcus.pptxcryptococcus.pptxcryptococcus.pptx
cryptococcus.pptxcryptococcus.pptxcryptococcus.pptx
VaisHali822687
 
Peripheral Retinal Degenerations. pptxxx
Peripheral Retinal Degenerations. pptxxxPeripheral Retinal Degenerations. pptxxx
Peripheral Retinal Degenerations. pptxxx
Dr. Geetika Singh
 
Interstitial brachytherapy in Ca CERVIX.pptx
Interstitial brachytherapy in Ca CERVIX.pptxInterstitial brachytherapy in Ca CERVIX.pptx
Interstitial brachytherapy in Ca CERVIX.pptx
Brijesh Maheshwari
 
JAUNDICE,BIOCHEMISTRY, FIRST MBBS STUDENTS
JAUNDICE,BIOCHEMISTRY, FIRST MBBS STUDENTSJAUNDICE,BIOCHEMISTRY, FIRST MBBS STUDENTS
JAUNDICE,BIOCHEMISTRY, FIRST MBBS STUDENTS
amitarathore081986
 
Advances in Novel Drug Therapy for Metabolic Dysfunction-associated Steatohep...
Advances in Novel Drug Therapy for Metabolic Dysfunction-associated Steatohep...Advances in Novel Drug Therapy for Metabolic Dysfunction-associated Steatohep...
Advances in Novel Drug Therapy for Metabolic Dysfunction-associated Steatohep...
syedanasir5
 
Indian Childhood Cirrhosis nn.pptx ICC PEDIA
Indian Childhood Cirrhosis nn.pptx ICC PEDIAIndian Childhood Cirrhosis nn.pptx ICC PEDIA
Indian Childhood Cirrhosis nn.pptx ICC PEDIA
Pooja Rani
 
NURSING REVISION NOTES 2 PATHO II UP.pptx
NURSING REVISION NOTES  2 PATHO II UP.pptxNURSING REVISION NOTES  2 PATHO II UP.pptx
NURSING REVISION NOTES 2 PATHO II UP.pptx
cherryhonours
 
Anaphylaxis Comprehensive Clinical Overview
Anaphylaxis Comprehensive Clinical OverviewAnaphylaxis Comprehensive Clinical Overview
Anaphylaxis Comprehensive Clinical Overview
Dr. BISHAL SAPKOTA
 
Hepatocellular carcinoma: From diagnosis to emerging therapeutics
Hepatocellular carcinoma: From diagnosis to emerging therapeuticsHepatocellular carcinoma: From diagnosis to emerging therapeutics
Hepatocellular carcinoma: From diagnosis to emerging therapeutics
ajayyadav753
 
COMMUNITY Bdcfgvbjhnkml;,lfgbjhmlASED HEALTH CARE I.pptx
COMMUNITY Bdcfgvbjhnkml;,lfgbjhmlASED HEALTH CARE I.pptxCOMMUNITY Bdcfgvbjhnkml;,lfgbjhmlASED HEALTH CARE I.pptx
COMMUNITY Bdcfgvbjhnkml;,lfgbjhmlASED HEALTH CARE I.pptx
FREDRICK CIIRA
 
REFRAMING OF EXPERTISE AND INFORMATION IN HEALTH
REFRAMING OF EXPERTISE AND INFORMATION IN HEALTHREFRAMING OF EXPERTISE AND INFORMATION IN HEALTH
REFRAMING OF EXPERTISE AND INFORMATION IN HEALTH
Tina Purnat
 
THE EYELID PPT FOR 1ST YEAR BSC OPTOMETRY
THE EYELID PPT FOR 1ST YEAR BSC OPTOMETRYTHE EYELID PPT FOR 1ST YEAR BSC OPTOMETRY
THE EYELID PPT FOR 1ST YEAR BSC OPTOMETRY
nihalanichz
 
Respiratory system harrison textbook part 1.docx
Respiratory system harrison textbook part 1.docxRespiratory system harrison textbook part 1.docx
Respiratory system harrison textbook part 1.docx
Haneen Hassan
 

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