SlideShare uma empresa Scribd logo
1 de 27
function myNonClosure() {            Variable lost after
    var date = new Date();           function returns
    return date.getMilliseconds();
}
function myClosure() {           Variable stays around
var date = new Date();           even after function returns
//nested function
return function () {
     return date.getMilliseconds();
     };
}
var calc = new Calculator('eqCtl');
calc.add(2,2)
var Calculator = function() {
     //private variables
     //private functions

     return {
          //public members
     };
};
var Calculator = function(eq) {
     //private member
     var eqCtl = document.getElementById(eq);

     return {
                                      var calculator = new Calculator('eq');
           //expose public member     calculator.add(2,2)
           add: function(x,y) {
                 var val = x + y;
                 eqCtl.innerHTML = val;
                 }
           };
};
<html>
...
    <script source="first.js"></script>
    <script source="second.js"></script>
</html>


// first.js
(function(ns) {                                      // second.js
            ns.Customer = function() {               (function(ns) {
                    this.name = "";                           ns.Order = function() { ... };
            };                                       }(window.WilderMinds = window.WilderMinds || {}));
}(window.WilderMinds = window.WilderMinds || {}));
<!DOCTYPE html>
<html lang="en">
<head>
         <meta charset="utf-8">
         <title>RequireJS</title>
</head>
<body>
         <script src="scripts/require.js" data-main="scripts/lib/main.js">
         </script>
</body>
</html>
// main.js
require(["Customer"],
       // Requires the Customer Module
       function (Customer) { // Call with required Module(s)
              // Your Initialization Code
              var c = new Customer("A Customer");
              var name = c.name;
       }
 );
// Customer.js
define( [], // Required Scripts (None)
       function(){
       // Gets any required modules here like main
       function Customer (name) {
                this.name = name
       }
       return Customer; // Return the object that Requires
                          //constructor to allow you to call it
}
Suresh.Balla@neudesic.com

Mais conteúdo relacionado

Mais procurados

Functional Reactive Programming - RxSwift
Functional Reactive Programming - RxSwiftFunctional Reactive Programming - RxSwift
Functional Reactive Programming - RxSwiftRodrigo Leite
 
React, Redux, ES2015 by Max Petruck
React, Redux, ES2015   by Max PetruckReact, Redux, ES2015   by Max Petruck
React, Redux, ES2015 by Max PetruckMaksym Petruk
 
Reactивная тяга
Reactивная тягаReactивная тяга
Reactивная тягаVitebsk Miniq
 
Reactive Programming Patterns with RxSwift
Reactive Programming Patterns with RxSwiftReactive Programming Patterns with RxSwift
Reactive Programming Patterns with RxSwiftFlorent Pillet
 
Net/http and the http.handler interface
Net/http and the http.handler interfaceNet/http and the http.handler interface
Net/http and the http.handler interfaceJoakim Gustin
 
Testando API's de forma unitária mocando as dependências
Testando API's de forma unitária mocando as dependênciasTestando API's de forma unitária mocando as dependências
Testando API's de forma unitária mocando as dependênciasMarcelo Aymone
 
Demoiselle 2.0 no JavaOne Brasil 2010
Demoiselle 2.0 no JavaOne Brasil 2010Demoiselle 2.0 no JavaOne Brasil 2010
Demoiselle 2.0 no JavaOne Brasil 2010Cleverson Sacramento
 
Magento2&amp;java script (2)
Magento2&amp;java script (2)Magento2&amp;java script (2)
Magento2&amp;java script (2)EvgeniyKapelko1
 
Why You Shouldn't Write OO
Why You Shouldn't Write OO Why You Shouldn't Write OO
Why You Shouldn't Write OO Yehuda Katz
 
Async js - Nemetschek Presentaion @ HackBulgaria
Async js - Nemetschek Presentaion @ HackBulgariaAsync js - Nemetschek Presentaion @ HackBulgaria
Async js - Nemetschek Presentaion @ HackBulgariaHackBulgaria
 
Promises, promises, and then observables
Promises, promises, and then observablesPromises, promises, and then observables
Promises, promises, and then observablesStefan Charsley
 
AngulrJS Overview
AngulrJS OverviewAngulrJS Overview
AngulrJS OverviewEyal Vardi
 

Mais procurados (18)

Functional Reactive Programming - RxSwift
Functional Reactive Programming - RxSwiftFunctional Reactive Programming - RxSwift
Functional Reactive Programming - RxSwift
 
16 18
16 1816 18
16 18
 
Hack tutorial
Hack tutorialHack tutorial
Hack tutorial
 
React with Redux
React with ReduxReact with Redux
React with Redux
 
React, Redux, ES2015 by Max Petruck
React, Redux, ES2015   by Max PetruckReact, Redux, ES2015   by Max Petruck
React, Redux, ES2015 by Max Petruck
 
Reactивная тяга
Reactивная тягаReactивная тяга
Reactивная тяга
 
Reactive Programming Patterns with RxSwift
Reactive Programming Patterns with RxSwiftReactive Programming Patterns with RxSwift
Reactive Programming Patterns with RxSwift
 
Net/http and the http.handler interface
Net/http and the http.handler interfaceNet/http and the http.handler interface
Net/http and the http.handler interface
 
Testing in JavaScript
Testing in JavaScriptTesting in JavaScript
Testing in JavaScript
 
Testando API's de forma unitária mocando as dependências
Testando API's de forma unitária mocando as dependênciasTestando API's de forma unitária mocando as dependências
Testando API's de forma unitária mocando as dependências
 
React и redux
React и reduxReact и redux
React и redux
 
Demoiselle 2.0 no JavaOne Brasil 2010
Demoiselle 2.0 no JavaOne Brasil 2010Demoiselle 2.0 no JavaOne Brasil 2010
Demoiselle 2.0 no JavaOne Brasil 2010
 
mediator
mediatormediator
mediator
 
Magento2&amp;java script (2)
Magento2&amp;java script (2)Magento2&amp;java script (2)
Magento2&amp;java script (2)
 
Why You Shouldn't Write OO
Why You Shouldn't Write OO Why You Shouldn't Write OO
Why You Shouldn't Write OO
 
Async js - Nemetschek Presentaion @ HackBulgaria
Async js - Nemetschek Presentaion @ HackBulgariaAsync js - Nemetschek Presentaion @ HackBulgaria
Async js - Nemetschek Presentaion @ HackBulgaria
 
Promises, promises, and then observables
Promises, promises, and then observablesPromises, promises, and then observables
Promises, promises, and then observables
 
AngulrJS Overview
AngulrJS OverviewAngulrJS Overview
AngulrJS Overview
 

Destaque

Html5 Canvas and Media
Html5 Canvas and MediaHtml5 Canvas and Media
Html5 Canvas and MediaSuresh Balla
 
React native - Under the Hood and App Live Updates without App Store Approval
React native - Under the Hood and App Live Updates without App Store ApprovalReact native - Under the Hood and App Live Updates without App Store Approval
React native - Under the Hood and App Live Updates without App Store ApprovalSuresh Balla
 
Developing context aware applications with iBeacons technology
Developing context aware applications with iBeacons technologyDeveloping context aware applications with iBeacons technology
Developing context aware applications with iBeacons technologySuresh Balla
 
Digital connections- Disease Vocab
Digital connections- Disease VocabDigital connections- Disease Vocab
Digital connections- Disease Vocab16veronicaa
 
Ad. New Deodorants
Ad. New DeodorantsAd. New Deodorants
Ad. New DeodorantsSandoz
 

Destaque (8)

Html5 Canvas and Media
Html5 Canvas and MediaHtml5 Canvas and Media
Html5 Canvas and Media
 
React native - Under the Hood and App Live Updates without App Store Approval
React native - Under the Hood and App Live Updates without App Store ApprovalReact native - Under the Hood and App Live Updates without App Store Approval
React native - Under the Hood and App Live Updates without App Store Approval
 
Developing context aware applications with iBeacons technology
Developing context aware applications with iBeacons technologyDeveloping context aware applications with iBeacons technology
Developing context aware applications with iBeacons technology
 
The Influence Of The Media Ppp
The Influence Of The Media PppThe Influence Of The Media Ppp
The Influence Of The Media Ppp
 
Filsafat islam
Filsafat islamFilsafat islam
Filsafat islam
 
Au Psy492 M7 A3 E Portf Lee C
Au Psy492 M7 A3 E Portf Lee CAu Psy492 M7 A3 E Portf Lee C
Au Psy492 M7 A3 E Portf Lee C
 
Digital connections- Disease Vocab
Digital connections- Disease VocabDigital connections- Disease Vocab
Digital connections- Disease Vocab
 
Ad. New Deodorants
Ad. New DeodorantsAd. New Deodorants
Ad. New Deodorants
 

Semelhante a Architecting JavaScript Code

Introduction to Zend Framework web services
Introduction to Zend Framework web servicesIntroduction to Zend Framework web services
Introduction to Zend Framework web servicesMichelangelo van Dam
 
What's new in jQuery 1.5
What's new in jQuery 1.5What's new in jQuery 1.5
What's new in jQuery 1.5Martin Kleppe
 
Ten useful JavaScript tips & best practices
Ten useful JavaScript tips & best practicesTen useful JavaScript tips & best practices
Ten useful JavaScript tips & best practicesAnkit Rastogi
 
Symfony2 Building on Alpha / Beta technology
Symfony2 Building on Alpha / Beta technologySymfony2 Building on Alpha / Beta technology
Symfony2 Building on Alpha / Beta technologyDaniel Knell
 
Symfony2 from the Trenches
Symfony2 from the TrenchesSymfony2 from the Trenches
Symfony2 from the TrenchesJonathan Wage
 
TypeScript Introduction
TypeScript IntroductionTypeScript Introduction
TypeScript IntroductionDmitry Sheiko
 
Object-Oriented JavaScript
Object-Oriented JavaScriptObject-Oriented JavaScript
Object-Oriented JavaScriptkvangork
 
Object-Oriented Javascript
Object-Oriented JavascriptObject-Oriented Javascript
Object-Oriented Javascriptkvangork
 
Virtual Madness @ Etsy
Virtual Madness @ EtsyVirtual Madness @ Etsy
Virtual Madness @ EtsyNishan Subedi
 
ZF2 for the ZF1 Developer
ZF2 for the ZF1 DeveloperZF2 for the ZF1 Developer
ZF2 for the ZF1 DeveloperGary Hockin
 
Doctrine For Beginners
Doctrine For BeginnersDoctrine For Beginners
Doctrine For BeginnersJonathan Wage
 
Clean code in JavaScript
Clean code in JavaScriptClean code in JavaScript
Clean code in JavaScriptMathieu Breton
 
HelsinkiJS meet-up. Dmitry Soshnikov - ECMAScript 6
HelsinkiJS meet-up. Dmitry Soshnikov - ECMAScript 6HelsinkiJS meet-up. Dmitry Soshnikov - ECMAScript 6
HelsinkiJS meet-up. Dmitry Soshnikov - ECMAScript 6Dmitry Soshnikov
 
Google App Engine Developer - Day3
Google App Engine Developer - Day3Google App Engine Developer - Day3
Google App Engine Developer - Day3Simon Su
 

Semelhante a Architecting JavaScript Code (20)

Introduction to Zend Framework web services
Introduction to Zend Framework web servicesIntroduction to Zend Framework web services
Introduction to Zend Framework web services
 
Javascript - Beyond-jQuery
Javascript - Beyond-jQueryJavascript - Beyond-jQuery
Javascript - Beyond-jQuery
 
What's new in jQuery 1.5
What's new in jQuery 1.5What's new in jQuery 1.5
What's new in jQuery 1.5
 
Ten useful JavaScript tips & best practices
Ten useful JavaScript tips & best practicesTen useful JavaScript tips & best practices
Ten useful JavaScript tips & best practices
 
Symfony2 Building on Alpha / Beta technology
Symfony2 Building on Alpha / Beta technologySymfony2 Building on Alpha / Beta technology
Symfony2 Building on Alpha / Beta technology
 
Symfony2 from the Trenches
Symfony2 from the TrenchesSymfony2 from the Trenches
Symfony2 from the Trenches
 
Clean Javascript
Clean JavascriptClean Javascript
Clean Javascript
 
TypeScript Introduction
TypeScript IntroductionTypeScript Introduction
TypeScript Introduction
 
Zend framework service
Zend framework serviceZend framework service
Zend framework service
 
Zend framework service
Zend framework serviceZend framework service
Zend framework service
 
Object-Oriented JavaScript
Object-Oriented JavaScriptObject-Oriented JavaScript
Object-Oriented JavaScript
 
Object-Oriented Javascript
Object-Oriented JavascriptObject-Oriented Javascript
Object-Oriented Javascript
 
Virtual Madness @ Etsy
Virtual Madness @ EtsyVirtual Madness @ Etsy
Virtual Madness @ Etsy
 
ZF2 for the ZF1 Developer
ZF2 for the ZF1 DeveloperZF2 for the ZF1 Developer
ZF2 for the ZF1 Developer
 
Doctrine For Beginners
Doctrine For BeginnersDoctrine For Beginners
Doctrine For Beginners
 
Clean code in JavaScript
Clean code in JavaScriptClean code in JavaScript
Clean code in JavaScript
 
HelsinkiJS meet-up. Dmitry Soshnikov - ECMAScript 6
HelsinkiJS meet-up. Dmitry Soshnikov - ECMAScript 6HelsinkiJS meet-up. Dmitry Soshnikov - ECMAScript 6
HelsinkiJS meet-up. Dmitry Soshnikov - ECMAScript 6
 
Ad java prac sol set
Ad java prac sol setAd java prac sol set
Ad java prac sol set
 
Backbone Basics with Examples
Backbone Basics with ExamplesBackbone Basics with Examples
Backbone Basics with Examples
 
Google App Engine Developer - Day3
Google App Engine Developer - Day3Google App Engine Developer - Day3
Google App Engine Developer - Day3
 

Último

شرح الدروس المهمة لعامة الأمة للشيخ ابن باز
شرح الدروس المهمة لعامة الأمة  للشيخ ابن بازشرح الدروس المهمة لعامة الأمة  للشيخ ابن باز
شرح الدروس المهمة لعامة الأمة للشيخ ابن بازJoEssam
 
Surah Yasin and Daily Spiritual Practices
Surah Yasin and Daily Spiritual PracticesSurah Yasin and Daily Spiritual Practices
Surah Yasin and Daily Spiritual Practicesaijazuddin14
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Punjabi Bagh | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Punjabi Bagh | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Punjabi Bagh | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Punjabi Bagh | Delhisoniya singh
 
Top Astrologer, Kala ilam expert in Multan and Black magic specialist in Sind...
Top Astrologer, Kala ilam expert in Multan and Black magic specialist in Sind...Top Astrologer, Kala ilam expert in Multan and Black magic specialist in Sind...
Top Astrologer, Kala ilam expert in Multan and Black magic specialist in Sind...baharayali
 
CALL ON ➥8923113531 🔝Call Girls Nishatganj Lucknow best Female service 🕶
CALL ON ➥8923113531 🔝Call Girls Nishatganj Lucknow best Female service  🕶CALL ON ➥8923113531 🔝Call Girls Nishatganj Lucknow best Female service  🕶
CALL ON ➥8923113531 🔝Call Girls Nishatganj Lucknow best Female service 🕶anilsa9823
 
(NISHA) Call Girls Sanath Nagar ✔️Just Call 7001035870✔️ HI-Fi Hyderabad Esco...
(NISHA) Call Girls Sanath Nagar ✔️Just Call 7001035870✔️ HI-Fi Hyderabad Esco...(NISHA) Call Girls Sanath Nagar ✔️Just Call 7001035870✔️ HI-Fi Hyderabad Esco...
(NISHA) Call Girls Sanath Nagar ✔️Just Call 7001035870✔️ HI-Fi Hyderabad Esco...Sanjna Singh
 
Dgital-Self-UTS-exploring-the-digital-self.pptx
Dgital-Self-UTS-exploring-the-digital-self.pptxDgital-Self-UTS-exploring-the-digital-self.pptx
Dgital-Self-UTS-exploring-the-digital-self.pptxsantosem70
 
Elite Class ➥8448380779▻ Call Girls In Naraina Delhi NCR
Elite Class ➥8448380779▻ Call Girls In Naraina Delhi NCRElite Class ➥8448380779▻ Call Girls In Naraina Delhi NCR
Elite Class ➥8448380779▻ Call Girls In Naraina Delhi NCRDelhi Call girls
 
Call Girls In East Of Kailash 9654467111 Short 1500 Night 6000
Call Girls In East Of Kailash 9654467111 Short 1500 Night 6000Call Girls In East Of Kailash 9654467111 Short 1500 Night 6000
Call Girls In East Of Kailash 9654467111 Short 1500 Night 6000Sapana Sha
 
Real Amil baba in Pakistan Real NO1 Amil baba Kala Jado Amil baba RAwalpindi ...
Real Amil baba in Pakistan Real NO1 Amil baba Kala Jado Amil baba RAwalpindi ...Real Amil baba in Pakistan Real NO1 Amil baba Kala Jado Amil baba RAwalpindi ...
Real Amil baba in Pakistan Real NO1 Amil baba Kala Jado Amil baba RAwalpindi ...Amil Baba Company
 
肄业证书结业证书《德国汉堡大学成绩单修改》Q微信741003700提供德国文凭照片可完整复刻汉堡大学毕业证精仿版本《【德国毕业证书】{汉堡大学文凭购买}》
肄业证书结业证书《德国汉堡大学成绩单修改》Q微信741003700提供德国文凭照片可完整复刻汉堡大学毕业证精仿版本《【德国毕业证书】{汉堡大学文凭购买}》肄业证书结业证书《德国汉堡大学成绩单修改》Q微信741003700提供德国文凭照片可完整复刻汉堡大学毕业证精仿版本《【德国毕业证书】{汉堡大学文凭购买}》
肄业证书结业证书《德国汉堡大学成绩单修改》Q微信741003700提供德国文凭照片可完整复刻汉堡大学毕业证精仿版本《【德国毕业证书】{汉堡大学文凭购买}》2tofliij
 
madina book to learn arabic part1
madina   book   to  learn  arabic  part1madina   book   to  learn  arabic  part1
madina book to learn arabic part1JoEssam
 
CALL ON ➥8923113531 🔝Call Girls Singar Nagar Lucknow best Night Fun service 👔
CALL ON ➥8923113531 🔝Call Girls Singar Nagar Lucknow best Night Fun service  👔CALL ON ➥8923113531 🔝Call Girls Singar Nagar Lucknow best Night Fun service  👔
CALL ON ➥8923113531 🔝Call Girls Singar Nagar Lucknow best Night Fun service 👔anilsa9823
 
Lucknow 💋 (Call Girls) in Lucknow | Book 8923113531 Extreme Naughty Call Girl...
Lucknow 💋 (Call Girls) in Lucknow | Book 8923113531 Extreme Naughty Call Girl...Lucknow 💋 (Call Girls) in Lucknow | Book 8923113531 Extreme Naughty Call Girl...
Lucknow 💋 (Call Girls) in Lucknow | Book 8923113531 Extreme Naughty Call Girl...anilsa9823
 
Call Girls in majnu ka tila Delhi 8264348440 ✅ call girls ❤️
Call Girls in majnu ka tila Delhi 8264348440 ✅ call girls ❤️Call Girls in majnu ka tila Delhi 8264348440 ✅ call girls ❤️
Call Girls in majnu ka tila Delhi 8264348440 ✅ call girls ❤️soniya singh
 
Call Girls in sarojini nagar Delhi 8264348440 ✅ call girls ❤️
Call Girls in sarojini nagar Delhi 8264348440 ✅ call girls ❤️Call Girls in sarojini nagar Delhi 8264348440 ✅ call girls ❤️
Call Girls in sarojini nagar Delhi 8264348440 ✅ call girls ❤️soniya singh
 
Pradeep Bhanot - Friend, Philosopher Guide And The Brand By Arjun Jani
Pradeep Bhanot - Friend, Philosopher Guide And The Brand By Arjun JaniPradeep Bhanot - Friend, Philosopher Guide And The Brand By Arjun Jani
Pradeep Bhanot - Friend, Philosopher Guide And The Brand By Arjun JaniPradeep Bhanot
 
No.1 Amil baba in Pakistan amil baba in Lahore amil baba in Karachi
No.1 Amil baba in Pakistan amil baba in Lahore amil baba in KarachiNo.1 Amil baba in Pakistan amil baba in Lahore amil baba in Karachi
No.1 Amil baba in Pakistan amil baba in Lahore amil baba in KarachiAmil Baba Mangal Maseeh
 
Study of the Psalms Chapter 1 verse 2 - wanderean
Study of the Psalms Chapter 1 verse 2 - wandereanStudy of the Psalms Chapter 1 verse 2 - wanderean
Study of the Psalms Chapter 1 verse 2 - wandereanmaricelcanoynuay
 

Último (20)

شرح الدروس المهمة لعامة الأمة للشيخ ابن باز
شرح الدروس المهمة لعامة الأمة  للشيخ ابن بازشرح الدروس المهمة لعامة الأمة  للشيخ ابن باز
شرح الدروس المهمة لعامة الأمة للشيخ ابن باز
 
Surah Yasin and Daily Spiritual Practices
Surah Yasin and Daily Spiritual PracticesSurah Yasin and Daily Spiritual Practices
Surah Yasin and Daily Spiritual Practices
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Punjabi Bagh | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Punjabi Bagh | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Punjabi Bagh | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Punjabi Bagh | Delhi
 
Top Astrologer, Kala ilam expert in Multan and Black magic specialist in Sind...
Top Astrologer, Kala ilam expert in Multan and Black magic specialist in Sind...Top Astrologer, Kala ilam expert in Multan and Black magic specialist in Sind...
Top Astrologer, Kala ilam expert in Multan and Black magic specialist in Sind...
 
CALL ON ➥8923113531 🔝Call Girls Nishatganj Lucknow best Female service 🕶
CALL ON ➥8923113531 🔝Call Girls Nishatganj Lucknow best Female service  🕶CALL ON ➥8923113531 🔝Call Girls Nishatganj Lucknow best Female service  🕶
CALL ON ➥8923113531 🔝Call Girls Nishatganj Lucknow best Female service 🕶
 
(NISHA) Call Girls Sanath Nagar ✔️Just Call 7001035870✔️ HI-Fi Hyderabad Esco...
(NISHA) Call Girls Sanath Nagar ✔️Just Call 7001035870✔️ HI-Fi Hyderabad Esco...(NISHA) Call Girls Sanath Nagar ✔️Just Call 7001035870✔️ HI-Fi Hyderabad Esco...
(NISHA) Call Girls Sanath Nagar ✔️Just Call 7001035870✔️ HI-Fi Hyderabad Esco...
 
Dgital-Self-UTS-exploring-the-digital-self.pptx
Dgital-Self-UTS-exploring-the-digital-self.pptxDgital-Self-UTS-exploring-the-digital-self.pptx
Dgital-Self-UTS-exploring-the-digital-self.pptx
 
Elite Class ➥8448380779▻ Call Girls In Naraina Delhi NCR
Elite Class ➥8448380779▻ Call Girls In Naraina Delhi NCRElite Class ➥8448380779▻ Call Girls In Naraina Delhi NCR
Elite Class ➥8448380779▻ Call Girls In Naraina Delhi NCR
 
Call Girls In East Of Kailash 9654467111 Short 1500 Night 6000
Call Girls In East Of Kailash 9654467111 Short 1500 Night 6000Call Girls In East Of Kailash 9654467111 Short 1500 Night 6000
Call Girls In East Of Kailash 9654467111 Short 1500 Night 6000
 
Real Amil baba in Pakistan Real NO1 Amil baba Kala Jado Amil baba RAwalpindi ...
Real Amil baba in Pakistan Real NO1 Amil baba Kala Jado Amil baba RAwalpindi ...Real Amil baba in Pakistan Real NO1 Amil baba Kala Jado Amil baba RAwalpindi ...
Real Amil baba in Pakistan Real NO1 Amil baba Kala Jado Amil baba RAwalpindi ...
 
肄业证书结业证书《德国汉堡大学成绩单修改》Q微信741003700提供德国文凭照片可完整复刻汉堡大学毕业证精仿版本《【德国毕业证书】{汉堡大学文凭购买}》
肄业证书结业证书《德国汉堡大学成绩单修改》Q微信741003700提供德国文凭照片可完整复刻汉堡大学毕业证精仿版本《【德国毕业证书】{汉堡大学文凭购买}》肄业证书结业证书《德国汉堡大学成绩单修改》Q微信741003700提供德国文凭照片可完整复刻汉堡大学毕业证精仿版本《【德国毕业证书】{汉堡大学文凭购买}》
肄业证书结业证书《德国汉堡大学成绩单修改》Q微信741003700提供德国文凭照片可完整复刻汉堡大学毕业证精仿版本《【德国毕业证书】{汉堡大学文凭购买}》
 
madina book to learn arabic part1
madina   book   to  learn  arabic  part1madina   book   to  learn  arabic  part1
madina book to learn arabic part1
 
Rohini Sector 21 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 21 Call Girls Delhi 9999965857 @Sabina Saikh No AdvanceRohini Sector 21 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 21 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
 
CALL ON ➥8923113531 🔝Call Girls Singar Nagar Lucknow best Night Fun service 👔
CALL ON ➥8923113531 🔝Call Girls Singar Nagar Lucknow best Night Fun service  👔CALL ON ➥8923113531 🔝Call Girls Singar Nagar Lucknow best Night Fun service  👔
CALL ON ➥8923113531 🔝Call Girls Singar Nagar Lucknow best Night Fun service 👔
 
Lucknow 💋 (Call Girls) in Lucknow | Book 8923113531 Extreme Naughty Call Girl...
Lucknow 💋 (Call Girls) in Lucknow | Book 8923113531 Extreme Naughty Call Girl...Lucknow 💋 (Call Girls) in Lucknow | Book 8923113531 Extreme Naughty Call Girl...
Lucknow 💋 (Call Girls) in Lucknow | Book 8923113531 Extreme Naughty Call Girl...
 
Call Girls in majnu ka tila Delhi 8264348440 ✅ call girls ❤️
Call Girls in majnu ka tila Delhi 8264348440 ✅ call girls ❤️Call Girls in majnu ka tila Delhi 8264348440 ✅ call girls ❤️
Call Girls in majnu ka tila Delhi 8264348440 ✅ call girls ❤️
 
Call Girls in sarojini nagar Delhi 8264348440 ✅ call girls ❤️
Call Girls in sarojini nagar Delhi 8264348440 ✅ call girls ❤️Call Girls in sarojini nagar Delhi 8264348440 ✅ call girls ❤️
Call Girls in sarojini nagar Delhi 8264348440 ✅ call girls ❤️
 
Pradeep Bhanot - Friend, Philosopher Guide And The Brand By Arjun Jani
Pradeep Bhanot - Friend, Philosopher Guide And The Brand By Arjun JaniPradeep Bhanot - Friend, Philosopher Guide And The Brand By Arjun Jani
Pradeep Bhanot - Friend, Philosopher Guide And The Brand By Arjun Jani
 
No.1 Amil baba in Pakistan amil baba in Lahore amil baba in Karachi
No.1 Amil baba in Pakistan amil baba in Lahore amil baba in KarachiNo.1 Amil baba in Pakistan amil baba in Lahore amil baba in Karachi
No.1 Amil baba in Pakistan amil baba in Lahore amil baba in Karachi
 
Study of the Psalms Chapter 1 verse 2 - wanderean
Study of the Psalms Chapter 1 verse 2 - wandereanStudy of the Psalms Chapter 1 verse 2 - wanderean
Study of the Psalms Chapter 1 verse 2 - wanderean
 

Architecting JavaScript Code

  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8. function myNonClosure() { Variable lost after var date = new Date(); function returns return date.getMilliseconds(); }
  • 9. function myClosure() { Variable stays around var date = new Date(); even after function returns //nested function return function () { return date.getMilliseconds(); }; }
  • 10.
  • 11.
  • 12. var calc = new Calculator('eqCtl'); calc.add(2,2)
  • 13.
  • 14.
  • 15.
  • 16. var Calculator = function() { //private variables //private functions return { //public members }; };
  • 17. var Calculator = function(eq) { //private member var eqCtl = document.getElementById(eq); return { var calculator = new Calculator('eq'); //expose public member calculator.add(2,2) add: function(x,y) { var val = x + y; eqCtl.innerHTML = val; } }; };
  • 18.
  • 19.
  • 20. <html> ... <script source="first.js"></script> <script source="second.js"></script> </html> // first.js (function(ns) { // second.js ns.Customer = function() { (function(ns) { this.name = ""; ns.Order = function() { ... }; }; }(window.WilderMinds = window.WilderMinds || {})); }(window.WilderMinds = window.WilderMinds || {}));
  • 21.
  • 22. <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>RequireJS</title> </head> <body> <script src="scripts/require.js" data-main="scripts/lib/main.js"> </script> </body> </html>
  • 23. // main.js require(["Customer"], // Requires the Customer Module function (Customer) { // Call with required Module(s) // Your Initialization Code var c = new Customer("A Customer"); var name = c.name; } );
  • 24. // Customer.js define( [], // Required Scripts (None) function(){ // Gets any required modules here like main function Customer (name) { this.name = name } return Customer; // Return the object that Requires //constructor to allow you to call it }
  • 25.
  • 26.

Notas do Editor

  1. HTML5 JavaScript codeTraditional ASP.NET vs ASP.NET MVCLoad views first and get all data – talk about Windows Azure Preview Portal, pivotal trackeretcSPAWindows 8 WinRT with HTML and JavaScript
  2. C:\\Users\\Suresh.Balla\\Desktop\\Win8\\Html5Demos\\2 - advanced\\C-RectanglesWithCircles.html
  3. C:\\Users\\Suresh.Balla\\Desktop\\Win8\\Html5Demos\\2 - advanced\\C-RectanglesWithCircles.html