SlideShare a Scribd company logo
Dibyendu Shankar Tiwary Javascript Unleashed (Javascript that you need to know but might not!!)
What is Javascript ? Introduction
It makes the wall to talk Introduction
What’s behind the scene? Introduction
Equation
I know it all Tell me something which I don’t know
Why are we here? JavaScript as a prototype-based language  JavaScript Objects Are Dictionaries   JavaScript Functions Are First Class   Constructor Functions but No Classes   Prototypes   Object-oriented programming with JavaScript Static Properties and Methods   Closures   Simulating Private Properties  Inheriting from Classes Coding tricks with JavaScript   Simulating Namespaces  Classes and Reflection Future of Javascript   Should You Code JavaScript This Way?  Putting It into Perspective
JavaScript Objects Are Dictionaries   Code Demo JavaScript Functions Are First Class   Code Demo Constructor Functions but No Classes Code Demo (Dog spot = new Dog(); ) Prototypes (I deserve to be a header of a slide) As you wish, but be sure you gonna use it. JavaScript as a prototype-based language
Every Function’s Prototype Has a Constructor Property  The prototype object is a central concept in object-oriented programming with JavaScript. Name comes from the idea that in JavaScript, an object is created as a copy of an existing example (that is, a prototype) object every function has a property named "prototype" that refers to a prototype object prototype object in turn has a property named "constructor," which refers back to the function itself (Confused ??) Code Demo : var buddy = new Dog(“Buddy“);  Prototypes (Happy   )
Objects Appear to Have Their Prototype’s Properties  Code Demo Prototypes (Another slide conquered)
Resolving toString() Method in the Prototype Chain Prototypes (Are you kinda hittin on me ??)
Inheriting from a Prototype Changes made to a prototype object are immediately visible to the objects that inherit from it, even after these objects are created. If you define a property/method X in an object, a property/method of the same name will be hidden in that object’s prototype. For instance, you can override Object.prototype’s toString method by defining a toString method in Dog.prototype. Changes only go in one direction, from prototype to its derived objects, but not vice versa. Code Demo Prototypes (Name the session after me)
Static Properties and Methods   Code Demo Closure   A closure is a runtime phenomenon that comes about when an inner function (or in C#, an inner anonymous method) is bound to the local variables of its outer function.  Confused?? ( Code demo is for the rescue) Simulating Private Properties A local variable in a function is normally not accessible from outside the function However, when that local variable is captured by an inner function’s closure, it lives on. Code Demo javascript.crockford.com Inheriting from Classes (Even I deserve a slide, Ok whatever!!) Oops in Javascript
Constructor functions and prototype objects allow you to simulate classes Can simulate private members of a class using closures  You haven’t seen how you can derive from your class A local variable in a function is normally not accessible from outside the function However, when that local variable is captured by an inner function’s closure, it lives on. Code Demo javascript.crockford.com You have a base class Pet, with one derived class Dog.  Stop talking show me the code. Inheritance from Classes (Happy   )
Simulating Namespaces In C++ and C#, namespaces are used to minimize the probability of name collisions Code Demo Classes and Reflection  there is no way to know the name of a function.  it wouldn’t help us in most situations as a class constructor is typically built by assigning an anonymous function to a namespaced variable. The reflection APIs in ASP.NET AJAX work over any type. Coding tips and Tricks in JavaScript
Should You Code JavaScript This Way? Should you code in JavaScript the way you code in C# or C++? Best practices for one language may not be the best practices for another Maybe, as Douglas Crockford says in his article " Prototypal Inheritance in JavaScript ", the JavaScript way of programming is to make prototype objects, and use the simple object function below to make new objects, which inherit from that original object: function object(o) { function F() {} F.prototype = o; return new F(); } Putting It into Perspective   I have found my JavaScript journey a rewarding experience.  Although not entirely without frustration along the way Registering Class Hierarchies and Calling Base.  It’s a journey not a destination. Future of Javscript
Thank you  ( If you are confused now I have done a good job, if not then an exceptional job   )

More Related Content

What's hot (20)

All of javascript
All of javascriptAll of javascript
All of javascript
Togakangaroo
 
JavaScript Patterns
JavaScript PatternsJavaScript Patterns
JavaScript Patterns
Stoyan Stefanov
 
Js fwdays unit tesing javascript(by Anna Khabibullina)
Js fwdays unit tesing javascript(by Anna Khabibullina)Js fwdays unit tesing javascript(by Anna Khabibullina)
Js fwdays unit tesing javascript(by Anna Khabibullina)
Anna Khabibullina
 
JS Frameworks Day April,26 of 2014
JS Frameworks Day April,26 of 2014JS Frameworks Day April,26 of 2014
JS Frameworks Day April,26 of 2014
DA-14
 
Effective Scala: Programming Patterns
Effective Scala: Programming PatternsEffective Scala: Programming Patterns
Effective Scala: Programming Patterns
Vasil Remeniuk
 
Advanced Object Oriented JavaScript (prototype, closure, scope, design patterns)
Advanced Object Oriented JavaScript (prototype, closure, scope, design patterns)Advanced Object Oriented JavaScript (prototype, closure, scope, design patterns)
Advanced Object Oriented JavaScript (prototype, closure, scope, design patterns)
raja kvk
 
Effective Scala (SoftShake 2013)
Effective Scala (SoftShake 2013)Effective Scala (SoftShake 2013)
Effective Scala (SoftShake 2013)
mircodotta
 
“Insulin” for Scala’s Syntactic Diabetes
“Insulin” for Scala’s Syntactic Diabetes“Insulin” for Scala’s Syntactic Diabetes
“Insulin” for Scala’s Syntactic Diabetes
Tzach Zohar
 
Douglas Crockford Presentation Goodparts
Douglas Crockford Presentation GoodpartsDouglas Crockford Presentation Goodparts
Douglas Crockford Presentation Goodparts
Ajax Experience 2009
 
JavaScript - From Birth To Closure
JavaScript - From Birth To ClosureJavaScript - From Birth To Closure
JavaScript - From Birth To Closure
Robert Nyman
 
Comparing Golang and understanding Java Value Types
Comparing Golang and understanding Java Value TypesComparing Golang and understanding Java Value Types
Comparing Golang and understanding Java Value Types
Péter Verhás
 
All of Javascript
All of JavascriptAll of Javascript
All of Javascript
Togakangaroo
 
Effective Scala (JavaDay Riga 2013)
Effective Scala (JavaDay Riga 2013)Effective Scala (JavaDay Riga 2013)
Effective Scala (JavaDay Riga 2013)
mircodotta
 
JavaScript in Object-Oriented Way
JavaScript in Object-Oriented WayJavaScript in Object-Oriented Way
JavaScript in Object-Oriented Way
Chamnap Chhorn
 
Javascript
JavascriptJavascript
Javascript
theacadian
 
Dependency Injection Why is it awesome and Why should I care?
Dependency Injection Why is it awesome and Why should I care?Dependency Injection Why is it awesome and Why should I care?
Dependency Injection Why is it awesome and Why should I care?
ColdFusionConference
 
TypeScript Best Practices
TypeScript Best PracticesTypeScript Best Practices
TypeScript Best Practices
felixbillon
 
Goodparts
GoodpartsGoodparts
Goodparts
damonjablons
 
Clean Code: Stop wasting my time
Clean Code: Stop wasting my timeClean Code: Stop wasting my time
Clean Code: Stop wasting my time
Edorian
 
Scalable JavaScript Design Patterns
Scalable JavaScript Design PatternsScalable JavaScript Design Patterns
Scalable JavaScript Design Patterns
Addy Osmani
 
Js fwdays unit tesing javascript(by Anna Khabibullina)
Js fwdays unit tesing javascript(by Anna Khabibullina)Js fwdays unit tesing javascript(by Anna Khabibullina)
Js fwdays unit tesing javascript(by Anna Khabibullina)
Anna Khabibullina
 
JS Frameworks Day April,26 of 2014
JS Frameworks Day April,26 of 2014JS Frameworks Day April,26 of 2014
JS Frameworks Day April,26 of 2014
DA-14
 
Effective Scala: Programming Patterns
Effective Scala: Programming PatternsEffective Scala: Programming Patterns
Effective Scala: Programming Patterns
Vasil Remeniuk
 
Advanced Object Oriented JavaScript (prototype, closure, scope, design patterns)
Advanced Object Oriented JavaScript (prototype, closure, scope, design patterns)Advanced Object Oriented JavaScript (prototype, closure, scope, design patterns)
Advanced Object Oriented JavaScript (prototype, closure, scope, design patterns)
raja kvk
 
Effective Scala (SoftShake 2013)
Effective Scala (SoftShake 2013)Effective Scala (SoftShake 2013)
Effective Scala (SoftShake 2013)
mircodotta
 
“Insulin” for Scala’s Syntactic Diabetes
“Insulin” for Scala’s Syntactic Diabetes“Insulin” for Scala’s Syntactic Diabetes
“Insulin” for Scala’s Syntactic Diabetes
Tzach Zohar
 
Douglas Crockford Presentation Goodparts
Douglas Crockford Presentation GoodpartsDouglas Crockford Presentation Goodparts
Douglas Crockford Presentation Goodparts
Ajax Experience 2009
 
JavaScript - From Birth To Closure
JavaScript - From Birth To ClosureJavaScript - From Birth To Closure
JavaScript - From Birth To Closure
Robert Nyman
 
Comparing Golang and understanding Java Value Types
Comparing Golang and understanding Java Value TypesComparing Golang and understanding Java Value Types
Comparing Golang and understanding Java Value Types
Péter Verhás
 
Effective Scala (JavaDay Riga 2013)
Effective Scala (JavaDay Riga 2013)Effective Scala (JavaDay Riga 2013)
Effective Scala (JavaDay Riga 2013)
mircodotta
 
JavaScript in Object-Oriented Way
JavaScript in Object-Oriented WayJavaScript in Object-Oriented Way
JavaScript in Object-Oriented Way
Chamnap Chhorn
 
Dependency Injection Why is it awesome and Why should I care?
Dependency Injection Why is it awesome and Why should I care?Dependency Injection Why is it awesome and Why should I care?
Dependency Injection Why is it awesome and Why should I care?
ColdFusionConference
 
TypeScript Best Practices
TypeScript Best PracticesTypeScript Best Practices
TypeScript Best Practices
felixbillon
 
Clean Code: Stop wasting my time
Clean Code: Stop wasting my timeClean Code: Stop wasting my time
Clean Code: Stop wasting my time
Edorian
 
Scalable JavaScript Design Patterns
Scalable JavaScript Design PatternsScalable JavaScript Design Patterns
Scalable JavaScript Design Patterns
Addy Osmani
 

Viewers also liked (11)

Ch 7 interpersonal
Ch 7   interpersonalCh 7   interpersonal
Ch 7 interpersonal
akn4fotos
 
Plan de entrenamiento ef
Plan de entrenamiento efPlan de entrenamiento ef
Plan de entrenamiento ef
school
 
Chapter 13: Using Good Language Skills
Chapter 13: Using Good Language SkillsChapter 13: Using Good Language Skills
Chapter 13: Using Good Language Skills
akn4fotos
 
Facil y dificil
Facil y dificilFacil y dificil
Facil y dificil
mmonica merida
 
4) Resume Of Chaudhary Attique
4) Resume Of Chaudhary Attique4) Resume Of Chaudhary Attique
4) Resume Of Chaudhary Attique
Chaudhary Attique
 
Chapter 2
Chapter 2Chapter 2
Chapter 2
akn4fotos
 
CH 6: Adapting Our Speech
CH 6: Adapting Our SpeechCH 6: Adapting Our Speech
CH 6: Adapting Our Speech
akn4fotos
 
Worksheethealthyhabits 100207070236-phpapp02
Worksheethealthyhabits 100207070236-phpapp02Worksheethealthyhabits 100207070236-phpapp02
Worksheethealthyhabits 100207070236-phpapp02
school
 
MANIPULACION DE CARPETAS
MANIPULACION DE CARPETASMANIPULACION DE CARPETAS
MANIPULACION DE CARPETAS
efrain19
 
Worksheetunhealthyhabits 100207070228-phpapp01
Worksheetunhealthyhabits 100207070228-phpapp01Worksheetunhealthyhabits 100207070228-phpapp01
Worksheetunhealthyhabits 100207070228-phpapp01
school
 
MY RESUME
MY RESUMEMY RESUME
MY RESUME
Muhammad Akid Mohamad Ashari
 
Ch 7 interpersonal
Ch 7   interpersonalCh 7   interpersonal
Ch 7 interpersonal
akn4fotos
 
Plan de entrenamiento ef
Plan de entrenamiento efPlan de entrenamiento ef
Plan de entrenamiento ef
school
 
Chapter 13: Using Good Language Skills
Chapter 13: Using Good Language SkillsChapter 13: Using Good Language Skills
Chapter 13: Using Good Language Skills
akn4fotos
 
4) Resume Of Chaudhary Attique
4) Resume Of Chaudhary Attique4) Resume Of Chaudhary Attique
4) Resume Of Chaudhary Attique
Chaudhary Attique
 
CH 6: Adapting Our Speech
CH 6: Adapting Our SpeechCH 6: Adapting Our Speech
CH 6: Adapting Our Speech
akn4fotos
 
Worksheethealthyhabits 100207070236-phpapp02
Worksheethealthyhabits 100207070236-phpapp02Worksheethealthyhabits 100207070236-phpapp02
Worksheethealthyhabits 100207070236-phpapp02
school
 
MANIPULACION DE CARPETAS
MANIPULACION DE CARPETASMANIPULACION DE CARPETAS
MANIPULACION DE CARPETAS
efrain19
 
Worksheetunhealthyhabits 100207070228-phpapp01
Worksheetunhealthyhabits 100207070228-phpapp01Worksheetunhealthyhabits 100207070228-phpapp01
Worksheetunhealthyhabits 100207070228-phpapp01
school
 
Ad

Similar to Java script unleashed (20)

Ian 20150116 java script oop
Ian 20150116 java script oopIan 20150116 java script oop
Ian 20150116 java script oop
LearningTech
 
Javascript
JavascriptJavascript
Javascript
Aditya Gaur
 
Prototype 120102020133-phpapp02
Prototype 120102020133-phpapp02Prototype 120102020133-phpapp02
Prototype 120102020133-phpapp02
plutoone TestTwo
 
Object oriented javascript
Object oriented javascriptObject oriented javascript
Object oriented javascript
Usman Mehmood
 
Javascript tid-bits
Javascript tid-bitsJavascript tid-bits
Javascript tid-bits
David Atchley
 
Advanced Javascript
Advanced JavascriptAdvanced Javascript
Advanced Javascript
relay12
 
Advanced Javascript
Advanced JavascriptAdvanced Javascript
Advanced Javascript
Manikanda kumar
 
Advanced Javascript
Advanced JavascriptAdvanced Javascript
Advanced Javascript
Adieu
 
Ajaxworld
AjaxworldAjaxworld
Ajaxworld
deannalagason
 
Javascript Prototypal Inheritance - Big Picture
Javascript Prototypal Inheritance - Big PictureJavascript Prototypal Inheritance - Big Picture
Javascript Prototypal Inheritance - Big Picture
Manish Jangir
 
OOPS JavaScript Interview Questions PDF By ScholarHat
OOPS JavaScript Interview Questions PDF By ScholarHatOOPS JavaScript Interview Questions PDF By ScholarHat
OOPS JavaScript Interview Questions PDF By ScholarHat
Scholarhat
 
JavaScript OOPS Implimentation
JavaScript OOPS ImplimentationJavaScript OOPS Implimentation
JavaScript OOPS Implimentation
Usman Mehmood
 
JavaScript Inheritance
JavaScript InheritanceJavaScript Inheritance
JavaScript Inheritance
Jussi Pohjolainen
 
JavaScript Essentials
JavaScript EssentialsJavaScript Essentials
JavaScript Essentials
Triphon Statkov
 
JavaScript In Object Oriented Way
JavaScript In Object Oriented WayJavaScript In Object Oriented Way
JavaScript In Object Oriented Way
Borey Lim
 
The prototype property
The prototype propertyThe prototype property
The prototype property
Hernan Mammana
 
Object Oriented Javascript part2
Object Oriented Javascript part2Object Oriented Javascript part2
Object Oriented Javascript part2
Usman Mehmood
 
Advanced JavaScript
Advanced JavaScriptAdvanced JavaScript
Advanced JavaScript
Stoyan Stefanov
 
Oojs 1.1
Oojs 1.1Oojs 1.1
Oojs 1.1
Rodica Dada
 
Javascript Objects Deep Dive
Javascript Objects Deep DiveJavascript Objects Deep Dive
Javascript Objects Deep Dive
Manish Jangir
 
Ian 20150116 java script oop
Ian 20150116 java script oopIan 20150116 java script oop
Ian 20150116 java script oop
LearningTech
 
Prototype 120102020133-phpapp02
Prototype 120102020133-phpapp02Prototype 120102020133-phpapp02
Prototype 120102020133-phpapp02
plutoone TestTwo
 
Object oriented javascript
Object oriented javascriptObject oriented javascript
Object oriented javascript
Usman Mehmood
 
Advanced Javascript
Advanced JavascriptAdvanced Javascript
Advanced Javascript
relay12
 
Advanced Javascript
Advanced JavascriptAdvanced Javascript
Advanced Javascript
Adieu
 
Javascript Prototypal Inheritance - Big Picture
Javascript Prototypal Inheritance - Big PictureJavascript Prototypal Inheritance - Big Picture
Javascript Prototypal Inheritance - Big Picture
Manish Jangir
 
OOPS JavaScript Interview Questions PDF By ScholarHat
OOPS JavaScript Interview Questions PDF By ScholarHatOOPS JavaScript Interview Questions PDF By ScholarHat
OOPS JavaScript Interview Questions PDF By ScholarHat
Scholarhat
 
JavaScript OOPS Implimentation
JavaScript OOPS ImplimentationJavaScript OOPS Implimentation
JavaScript OOPS Implimentation
Usman Mehmood
 
JavaScript In Object Oriented Way
JavaScript In Object Oriented WayJavaScript In Object Oriented Way
JavaScript In Object Oriented Way
Borey Lim
 
The prototype property
The prototype propertyThe prototype property
The prototype property
Hernan Mammana
 
Object Oriented Javascript part2
Object Oriented Javascript part2Object Oriented Javascript part2
Object Oriented Javascript part2
Usman Mehmood
 
Javascript Objects Deep Dive
Javascript Objects Deep DiveJavascript Objects Deep Dive
Javascript Objects Deep Dive
Manish Jangir
 
Ad

Recently uploaded (20)

What are the benefits that dance brings?
What are the benefits that dance brings?What are the benefits that dance brings?
What are the benefits that dance brings?
memi27
 
How to Create a Rainbow Man Effect in Odoo 18
How to Create a Rainbow Man Effect in Odoo 18How to Create a Rainbow Man Effect in Odoo 18
How to Create a Rainbow Man Effect in Odoo 18
Celine George
 
How to Configure Vendor Management in Lunch App of Odoo 18
How to Configure Vendor Management in Lunch App of Odoo 18How to Configure Vendor Management in Lunch App of Odoo 18
How to Configure Vendor Management in Lunch App of Odoo 18
Celine George
 
LDMMIA Reiki Yoga Next Week Grad Updates
LDMMIA Reiki Yoga Next Week Grad UpdatesLDMMIA Reiki Yoga Next Week Grad Updates
LDMMIA Reiki Yoga Next Week Grad Updates
LDM & Mia eStudios
 
Trends Spotting Strategic foresight for tomorrow’s education systems - Debora...
Trends Spotting Strategic foresight for tomorrow’s education systems - Debora...Trends Spotting Strategic foresight for tomorrow’s education systems - Debora...
Trends Spotting Strategic foresight for tomorrow’s education systems - Debora...
EduSkills OECD
 
Diptera: The Two-Winged Wonders, The Fly Squad: Order Diptera.pptx
Diptera: The Two-Winged Wonders, The Fly Squad: Order Diptera.pptxDiptera: The Two-Winged Wonders, The Fly Squad: Order Diptera.pptx
Diptera: The Two-Winged Wonders, The Fly Squad: Order Diptera.pptx
Arshad Shaikh
 
Allomorps and word formation.pptx - Google Slides.pdf
Allomorps and word formation.pptx - Google Slides.pdfAllomorps and word formation.pptx - Google Slides.pdf
Allomorps and word formation.pptx - Google Slides.pdf
Abha Pandey
 
MATERI PPT TOPIK 1 LANDASAN FILOSOFIS PENDIDIKAN
MATERI PPT TOPIK 1 LANDASAN FILOSOFIS PENDIDIKANMATERI PPT TOPIK 1 LANDASAN FILOSOFIS PENDIDIKAN
MATERI PPT TOPIK 1 LANDASAN FILOSOFIS PENDIDIKAN
aditya23173
 
Parenting Teens: Supporting Trust, resilience and independence
Parenting Teens: Supporting Trust, resilience and independenceParenting Teens: Supporting Trust, resilience and independence
Parenting Teens: Supporting Trust, resilience and independence
Pooky Knightsmith
 
What is FIle and explanation of text files.pptx
What is FIle and explanation of text files.pptxWhat is FIle and explanation of text files.pptx
What is FIle and explanation of text files.pptx
Ramakrishna Reddy Bijjam
 
SEXUALITY , UNWANTED PREGANCY AND SEXUAL ASSAULT .pptx
SEXUALITY , UNWANTED PREGANCY AND SEXUAL ASSAULT .pptxSEXUALITY , UNWANTED PREGANCY AND SEXUAL ASSAULT .pptx
SEXUALITY , UNWANTED PREGANCY AND SEXUAL ASSAULT .pptx
PoojaSen20
 
june 10 2025 ppt for madden on art science is over.pptx
june 10 2025 ppt for madden on art science is over.pptxjune 10 2025 ppt for madden on art science is over.pptx
june 10 2025 ppt for madden on art science is over.pptx
roger malina
 
Unit- 4 Biostatistics & Research Methodology.pdf
Unit- 4 Biostatistics & Research Methodology.pdfUnit- 4 Biostatistics & Research Methodology.pdf
Unit- 4 Biostatistics & Research Methodology.pdf
KRUTIKA CHANNE
 
MATERI PPT TOPIK 4 LANDASAN FILOSOFIS PENDIDIKAN
MATERI PPT TOPIK 4 LANDASAN FILOSOFIS PENDIDIKANMATERI PPT TOPIK 4 LANDASAN FILOSOFIS PENDIDIKAN
MATERI PPT TOPIK 4 LANDASAN FILOSOFIS PENDIDIKAN
aditya23173
 
Gibson "Secrets to Changing Behaviour in Scholarly Communication: A 2025 NISO...
Gibson "Secrets to Changing Behaviour in Scholarly Communication: A 2025 NISO...Gibson "Secrets to Changing Behaviour in Scholarly Communication: A 2025 NISO...
Gibson "Secrets to Changing Behaviour in Scholarly Communication: A 2025 NISO...
National Information Standards Organization (NISO)
 
How to Create Quotation Templates Sequence in Odoo 18 Sales
How to Create Quotation Templates Sequence in Odoo 18 SalesHow to Create Quotation Templates Sequence in Odoo 18 Sales
How to Create Quotation Templates Sequence in Odoo 18 Sales
Celine George
 
Final Sketch Designs for poster production.pptx
Final Sketch Designs for poster production.pptxFinal Sketch Designs for poster production.pptx
Final Sketch Designs for poster production.pptx
bobby205207
 
Nice Dream.pdf /
Nice Dream.pdf                              /Nice Dream.pdf                              /
Nice Dream.pdf /
ErinUsher3
 
LDMMIA Free Reiki Yoga S9 Grad Level Intuition II
LDMMIA Free Reiki Yoga S9 Grad Level Intuition IILDMMIA Free Reiki Yoga S9 Grad Level Intuition II
LDMMIA Free Reiki Yoga S9 Grad Level Intuition II
LDM & Mia eStudios
 
How to Manage Maintenance Request in Odoo 18
How to Manage Maintenance Request in Odoo 18How to Manage Maintenance Request in Odoo 18
How to Manage Maintenance Request in Odoo 18
Celine George
 
What are the benefits that dance brings?
What are the benefits that dance brings?What are the benefits that dance brings?
What are the benefits that dance brings?
memi27
 
How to Create a Rainbow Man Effect in Odoo 18
How to Create a Rainbow Man Effect in Odoo 18How to Create a Rainbow Man Effect in Odoo 18
How to Create a Rainbow Man Effect in Odoo 18
Celine George
 
How to Configure Vendor Management in Lunch App of Odoo 18
How to Configure Vendor Management in Lunch App of Odoo 18How to Configure Vendor Management in Lunch App of Odoo 18
How to Configure Vendor Management in Lunch App of Odoo 18
Celine George
 
LDMMIA Reiki Yoga Next Week Grad Updates
LDMMIA Reiki Yoga Next Week Grad UpdatesLDMMIA Reiki Yoga Next Week Grad Updates
LDMMIA Reiki Yoga Next Week Grad Updates
LDM & Mia eStudios
 
Trends Spotting Strategic foresight for tomorrow’s education systems - Debora...
Trends Spotting Strategic foresight for tomorrow’s education systems - Debora...Trends Spotting Strategic foresight for tomorrow’s education systems - Debora...
Trends Spotting Strategic foresight for tomorrow’s education systems - Debora...
EduSkills OECD
 
Diptera: The Two-Winged Wonders, The Fly Squad: Order Diptera.pptx
Diptera: The Two-Winged Wonders, The Fly Squad: Order Diptera.pptxDiptera: The Two-Winged Wonders, The Fly Squad: Order Diptera.pptx
Diptera: The Two-Winged Wonders, The Fly Squad: Order Diptera.pptx
Arshad Shaikh
 
Allomorps and word formation.pptx - Google Slides.pdf
Allomorps and word formation.pptx - Google Slides.pdfAllomorps and word formation.pptx - Google Slides.pdf
Allomorps and word formation.pptx - Google Slides.pdf
Abha Pandey
 
MATERI PPT TOPIK 1 LANDASAN FILOSOFIS PENDIDIKAN
MATERI PPT TOPIK 1 LANDASAN FILOSOFIS PENDIDIKANMATERI PPT TOPIK 1 LANDASAN FILOSOFIS PENDIDIKAN
MATERI PPT TOPIK 1 LANDASAN FILOSOFIS PENDIDIKAN
aditya23173
 
Parenting Teens: Supporting Trust, resilience and independence
Parenting Teens: Supporting Trust, resilience and independenceParenting Teens: Supporting Trust, resilience and independence
Parenting Teens: Supporting Trust, resilience and independence
Pooky Knightsmith
 
What is FIle and explanation of text files.pptx
What is FIle and explanation of text files.pptxWhat is FIle and explanation of text files.pptx
What is FIle and explanation of text files.pptx
Ramakrishna Reddy Bijjam
 
SEXUALITY , UNWANTED PREGANCY AND SEXUAL ASSAULT .pptx
SEXUALITY , UNWANTED PREGANCY AND SEXUAL ASSAULT .pptxSEXUALITY , UNWANTED PREGANCY AND SEXUAL ASSAULT .pptx
SEXUALITY , UNWANTED PREGANCY AND SEXUAL ASSAULT .pptx
PoojaSen20
 
june 10 2025 ppt for madden on art science is over.pptx
june 10 2025 ppt for madden on art science is over.pptxjune 10 2025 ppt for madden on art science is over.pptx
june 10 2025 ppt for madden on art science is over.pptx
roger malina
 
Unit- 4 Biostatistics & Research Methodology.pdf
Unit- 4 Biostatistics & Research Methodology.pdfUnit- 4 Biostatistics & Research Methodology.pdf
Unit- 4 Biostatistics & Research Methodology.pdf
KRUTIKA CHANNE
 
MATERI PPT TOPIK 4 LANDASAN FILOSOFIS PENDIDIKAN
MATERI PPT TOPIK 4 LANDASAN FILOSOFIS PENDIDIKANMATERI PPT TOPIK 4 LANDASAN FILOSOFIS PENDIDIKAN
MATERI PPT TOPIK 4 LANDASAN FILOSOFIS PENDIDIKAN
aditya23173
 
How to Create Quotation Templates Sequence in Odoo 18 Sales
How to Create Quotation Templates Sequence in Odoo 18 SalesHow to Create Quotation Templates Sequence in Odoo 18 Sales
How to Create Quotation Templates Sequence in Odoo 18 Sales
Celine George
 
Final Sketch Designs for poster production.pptx
Final Sketch Designs for poster production.pptxFinal Sketch Designs for poster production.pptx
Final Sketch Designs for poster production.pptx
bobby205207
 
Nice Dream.pdf /
Nice Dream.pdf                              /Nice Dream.pdf                              /
Nice Dream.pdf /
ErinUsher3
 
LDMMIA Free Reiki Yoga S9 Grad Level Intuition II
LDMMIA Free Reiki Yoga S9 Grad Level Intuition IILDMMIA Free Reiki Yoga S9 Grad Level Intuition II
LDMMIA Free Reiki Yoga S9 Grad Level Intuition II
LDM & Mia eStudios
 
How to Manage Maintenance Request in Odoo 18
How to Manage Maintenance Request in Odoo 18How to Manage Maintenance Request in Odoo 18
How to Manage Maintenance Request in Odoo 18
Celine George
 

Java script unleashed

  • 1. Dibyendu Shankar Tiwary Javascript Unleashed (Javascript that you need to know but might not!!)
  • 2. What is Javascript ? Introduction
  • 3. It makes the wall to talk Introduction
  • 4. What’s behind the scene? Introduction
  • 6. I know it all Tell me something which I don’t know
  • 7. Why are we here? JavaScript as a prototype-based language JavaScript Objects Are Dictionaries JavaScript Functions Are First Class Constructor Functions but No Classes Prototypes Object-oriented programming with JavaScript Static Properties and Methods Closures Simulating Private Properties Inheriting from Classes Coding tricks with JavaScript Simulating Namespaces Classes and Reflection Future of Javascript Should You Code JavaScript This Way? Putting It into Perspective
  • 8. JavaScript Objects Are Dictionaries Code Demo JavaScript Functions Are First Class Code Demo Constructor Functions but No Classes Code Demo (Dog spot = new Dog(); ) Prototypes (I deserve to be a header of a slide) As you wish, but be sure you gonna use it. JavaScript as a prototype-based language
  • 9. Every Function’s Prototype Has a Constructor Property  The prototype object is a central concept in object-oriented programming with JavaScript. Name comes from the idea that in JavaScript, an object is created as a copy of an existing example (that is, a prototype) object every function has a property named "prototype" that refers to a prototype object prototype object in turn has a property named "constructor," which refers back to the function itself (Confused ??) Code Demo : var buddy = new Dog(“Buddy“); Prototypes (Happy  )
  • 10. Objects Appear to Have Their Prototype’s Properties Code Demo Prototypes (Another slide conquered)
  • 11. Resolving toString() Method in the Prototype Chain Prototypes (Are you kinda hittin on me ??)
  • 12. Inheriting from a Prototype Changes made to a prototype object are immediately visible to the objects that inherit from it, even after these objects are created. If you define a property/method X in an object, a property/method of the same name will be hidden in that object’s prototype. For instance, you can override Object.prototype’s toString method by defining a toString method in Dog.prototype. Changes only go in one direction, from prototype to its derived objects, but not vice versa. Code Demo Prototypes (Name the session after me)
  • 13. Static Properties and Methods Code Demo Closure A closure is a runtime phenomenon that comes about when an inner function (or in C#, an inner anonymous method) is bound to the local variables of its outer function. Confused?? ( Code demo is for the rescue) Simulating Private Properties A local variable in a function is normally not accessible from outside the function However, when that local variable is captured by an inner function’s closure, it lives on. Code Demo javascript.crockford.com Inheriting from Classes (Even I deserve a slide, Ok whatever!!) Oops in Javascript
  • 14. Constructor functions and prototype objects allow you to simulate classes Can simulate private members of a class using closures You haven’t seen how you can derive from your class A local variable in a function is normally not accessible from outside the function However, when that local variable is captured by an inner function’s closure, it lives on. Code Demo javascript.crockford.com You have a base class Pet, with one derived class Dog. Stop talking show me the code. Inheritance from Classes (Happy  )
  • 15. Simulating Namespaces In C++ and C#, namespaces are used to minimize the probability of name collisions Code Demo Classes and Reflection there is no way to know the name of a function. it wouldn’t help us in most situations as a class constructor is typically built by assigning an anonymous function to a namespaced variable. The reflection APIs in ASP.NET AJAX work over any type. Coding tips and Tricks in JavaScript
  • 16. Should You Code JavaScript This Way? Should you code in JavaScript the way you code in C# or C++? Best practices for one language may not be the best practices for another Maybe, as Douglas Crockford says in his article " Prototypal Inheritance in JavaScript ", the JavaScript way of programming is to make prototype objects, and use the simple object function below to make new objects, which inherit from that original object: function object(o) { function F() {} F.prototype = o; return new F(); } Putting It into Perspective I have found my JavaScript journey a rewarding experience. Although not entirely without frustration along the way Registering Class Hierarchies and Calling Base. It’s a journey not a destination. Future of Javscript
  • 17. Thank you ( If you are confused now I have done a good job, if not then an exceptional job  )

Editor's Notes

  • #2: Hi, welcome everybody. Today let’s discuss about virtualization and how it helps to improve our productivity during day to day software development.
  • #3: . How the javascript evolution came to the being of what it is today, we have always designated javascript as a second fiddle language in our programming careers.
  • #4: The web becomes interactive and the wall talks back, it powers the web pages which start listening to your needs.
  • #5: Javascript sits with HTML abd CSS as one of the three pieces of modern web page construction. One must follow the trail of the structure (HTML), to style (CSS), and then to action (Javascript)
  • #9: So we’ve seen ways to create an object, complete with its properties and methods. But if you notice all the snippets above, the properties and methods are hardcoded within the object definition itself. What if you need more control over the object creation? For example, you may need to calculate the values of the object’s properties based on some parameters. Or you may need to initialize the object’s properties to the values that you’ll only have at run time. Or you may need to create more than one instance of the object, which is a very common requirement. In C#, we use classes to instantiate object instances. But JavaScript is different since it doesn’t have classes. Instead, as you’ll see in the next section, you take advantage of the fact that functions act as constructors when used together with the "new" operator.
  • #10: The prototype object is a central concept in object-oriented programming with JavaScript. Name comes from the idea that in JavaScript, an object is created as a copy of an existing example (that is, a prototype) object every function has a property named "prototype" that refers to a prototype object prototype object in turn has a property named "constructor," which refers back to the function itself (Confused ??) Code Demo : var buddy = new Dog(“Buddy“);
  • #12: Refer to the code in 4Prototype.aspx