SlideShare uma empresa Scribd logo
1 de 22
1 / <count>
JAVASCRIPT:
‘UNDERSTANDING THE WEIRD PART’(I)
@RajohnsonAndry
2 / <count>
INTRODUCTION AND THE
GOAL
3 / <count>
FOCUS ON JAVASCRIPT
« THE PROGRAMMING LANGUAGE »
 LEARN HOW JAVASCRIPT WORKS UNDER THE
HOOD
 UNDERSTAND THINGS THAT PEOPLE WHO
BUILD JQUERY UNDERSTAND
 UNDERSTAND HOW POWERFULL AND
BEAUTIFUL IS JAVASCRIPT
4 / <count>
DON’T IMITATE,
UNDERSTAND !
 STOP LEARNING CODE BY COPYING SOME CODE ON
SCREEN OR PIECE OF PAPER
 FOCUS ON BASICS CONCEPTS:
 SYNTHAX PARSER,
 EXECUTION CONTEXT,
 NAME/PAIR VALUES,
 OBJECTS,
 VARIABLES ,
 FUNCTIONS ;
5 / <count>
UNDERSTAND, FRAMEWORKS, AND THE
WEIRD PARTS..
6 / <count>
SYNTAX PARSER
A PROGRAM THAT READS YOUR CODE AND
DETERMINE WHAT IT DOES AND IF ITS
GRAMMAR IS VALID.
« Your code isn’t magic. Someone else wrote a
program to translate it for the computer »
7 / <count>
Your Code :
Function hello() {
let a = ‘Hello World’ ;
}
Computer Instructions
Function
variable
8 / <count>
EXECUTION CONTEXT :
A WRAPPER TO HELP MANAGE THE CODE THAT
IS RUNNING
 There are lots of lexical environnements . Which one is
currently running is managed via execution contexts. It can
contain things beyond what you’ve written in your code
9 / <count>
CONCEPT OF NAME/VALUE PAIR AND
OBJECTS
A NAME WHICH MAPS TO A UNIQUE VALUE
 The name may be defined more than one , but only
can have one value in any giving context.
 That value may be more name/value pair.
10 / <count>
Address = ‘9 rue George Marette’
11 / <count>
OBJECT :
A COLLECTION OF NAME/ VALUE PAIRS
The simplest definition when talking about
JavaScript.
12 / <count>
Address :
{
Street : ‘George Marette’,
Number : 9
Appartment :
{
Floor : 1
Number : 201,
}
}
13 / <count>
THE GLOBAL ENVIRONMENT AND THE
GLOBAL OBJECT
 PEOPLE : ‘ARE WE GOING TO CODE
ACTUALLY ?’
 ME : ‘YES !’
Setup
15 / <count>
Execution Context (Global)
Global Object
(window)
‘this’
16 / <count>
Live coding to show you...
17 / <count>
Execution Context
Global Object
« not inside a
Function »
‘this’
Outer
Environnent
Your code
18 / <count>
EXECUTION CONTEXT :
CREATION AND
‘HOISTING’(‘hissage’ en français)
19 / <count>
//b();
//console.log(a);
var a = 'Hello World';
function b(){
console.log('called b!');
}
b();
console.log(a);
20 / <count>
Execution Context is Created (CREATION PHASE)
Global Object ‘this’
Outer
Environnent
Setup Memory Space for
Variables and Functions
« Hoisting »
21 / <count>
Variables are setup and set equal to
‘undefined’
b();
console.log(a);
var a = 'Hello World';
function b() {
console.log('Called b');
}
// Called b
// Undefined
22 / <count>
Understanding ‘undifined’
concept in JS ?
Let try out this code and see what happens :
let a;
console.log(a);
if (a === undefined) {
console.log('a is undifed!');
}
else {
console.log('a is defined!');
}
//expected output undifined , a is undifined

Mais conteúdo relacionado

Semelhante a Java script the weird part (PART I )

Best Practices in apps development with Titanium Appcelerator
Best Practices in apps development with Titanium Appcelerator Best Practices in apps development with Titanium Appcelerator
Best Practices in apps development with Titanium Appcelerator
Alessio Ricco
 
BEST PRACTICES PER LA SCRITTURA DI APPLICAZIONI TITANIUM APPCELERATOR - Aless...
BEST PRACTICES PER LA SCRITTURA DI APPLICAZIONI TITANIUM APPCELERATOR - Aless...BEST PRACTICES PER LA SCRITTURA DI APPLICAZIONI TITANIUM APPCELERATOR - Aless...
BEST PRACTICES PER LA SCRITTURA DI APPLICAZIONI TITANIUM APPCELERATOR - Aless...
Whymca
 
Building with JavaScript - write less by using the right tools
Building with JavaScript -  write less by using the right toolsBuilding with JavaScript -  write less by using the right tools
Building with JavaScript - write less by using the right tools
Christian Heilmann
 
Tom Germeau: Mobile Apps: Finding the balance between performance and flexibi...
Tom Germeau: Mobile Apps: Finding the balance between performance and flexibi...Tom Germeau: Mobile Apps: Finding the balance between performance and flexibi...
Tom Germeau: Mobile Apps: Finding the balance between performance and flexibi...
Chartbeat
 

Semelhante a Java script the weird part (PART I ) (20)

Best Practices in apps development with Titanium Appcelerator
Best Practices in apps development with Titanium Appcelerator Best Practices in apps development with Titanium Appcelerator
Best Practices in apps development with Titanium Appcelerator
 
BEST PRACTICES PER LA SCRITTURA DI APPLICAZIONI TITANIUM APPCELERATOR - Aless...
BEST PRACTICES PER LA SCRITTURA DI APPLICAZIONI TITANIUM APPCELERATOR - Aless...BEST PRACTICES PER LA SCRITTURA DI APPLICAZIONI TITANIUM APPCELERATOR - Aless...
BEST PRACTICES PER LA SCRITTURA DI APPLICAZIONI TITANIUM APPCELERATOR - Aless...
 
HTML5 for the Silverlight Guy
HTML5 for the Silverlight GuyHTML5 for the Silverlight Guy
HTML5 for the Silverlight Guy
 
Interpolique
InterpoliqueInterpolique
Interpolique
 
Bringing choas to order in your node.js app
Bringing choas to order in your node.js appBringing choas to order in your node.js app
Bringing choas to order in your node.js app
 
JavaScript Neednt Hurt - JavaBin talk
JavaScript Neednt Hurt - JavaBin talkJavaScript Neednt Hurt - JavaBin talk
JavaScript Neednt Hurt - JavaBin talk
 
Big Data Web applications for Interactive Hadoop by ENRICO BERTI at Big Data...
 Big Data Web applications for Interactive Hadoop by ENRICO BERTI at Big Data... Big Data Web applications for Interactive Hadoop by ENRICO BERTI at Big Data...
Big Data Web applications for Interactive Hadoop by ENRICO BERTI at Big Data...
 
LISA Qooxdoo Tutorial Handouts
LISA Qooxdoo Tutorial HandoutsLISA Qooxdoo Tutorial Handouts
LISA Qooxdoo Tutorial Handouts
 
Interpolique
InterpoliqueInterpolique
Interpolique
 
Building native Android applications with Mirah and Pindah
Building native Android applications with Mirah and PindahBuilding native Android applications with Mirah and Pindah
Building native Android applications with Mirah and Pindah
 
Ruby conf2012
Ruby conf2012Ruby conf2012
Ruby conf2012
 
Building with JavaScript - write less by using the right tools
Building with JavaScript -  write less by using the right toolsBuilding with JavaScript -  write less by using the right tools
Building with JavaScript - write less by using the right tools
 
Javascript status 2016
Javascript status 2016Javascript status 2016
Javascript status 2016
 
Scalding for Hadoop
Scalding for HadoopScalding for Hadoop
Scalding for Hadoop
 
C# 6.0
C# 6.0C# 6.0
C# 6.0
 
Tom Germeau: Mobile Apps: Finding the balance between performance and flexibi...
Tom Germeau: Mobile Apps: Finding the balance between performance and flexibi...Tom Germeau: Mobile Apps: Finding the balance between performance and flexibi...
Tom Germeau: Mobile Apps: Finding the balance between performance and flexibi...
 
Using BDD to Solve communication problems
Using BDD to Solve communication problemsUsing BDD to Solve communication problems
Using BDD to Solve communication problems
 
Fewd week5 slides
Fewd week5 slidesFewd week5 slides
Fewd week5 slides
 
Rubyconf2016 - Solving communication problems in distributed teams with BDD
Rubyconf2016 - Solving communication problems in distributed teams with BDDRubyconf2016 - Solving communication problems in distributed teams with BDD
Rubyconf2016 - Solving communication problems in distributed teams with BDD
 
Behavior Driven Development with Rails
Behavior Driven Development with RailsBehavior Driven Development with Rails
Behavior Driven Development with Rails
 

Mais de AndryRajohnson (7)

Meetup Javascript for beginner
Meetup Javascript for beginner Meetup Javascript for beginner
Meetup Javascript for beginner
 
React 101
React 101React 101
React 101
 
Git et github (1)
Git et github (1)Git et github (1)
Git et github (1)
 
2h landing page
2h landing page 2h landing page
2h landing page
 
Modern web app with REACT
Modern web app with REACTModern web app with REACT
Modern web app with REACT
 
Functionnal programming
Functionnal programmingFunctionnal programming
Functionnal programming
 
Coder son site web
Coder son site webCoder son site web
Coder son site web
 

Último

UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
rknatarajan
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
dharasingh5698
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college project
Tonystark477637
 

Último (20)

(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSIS
 
Online banking management system project.pdf
Online banking management system project.pdfOnline banking management system project.pdf
Online banking management system project.pdf
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptx
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
 
Roadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and RoutesRoadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and Routes
 
University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdf
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptx
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptx
 
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
 
Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024
 
Glass Ceramics: Processing and Properties
Glass Ceramics: Processing and PropertiesGlass Ceramics: Processing and Properties
Glass Ceramics: Processing and Properties
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college project
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writing
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 

Java script the weird part (PART I )

  • 1. 1 / <count> JAVASCRIPT: ‘UNDERSTANDING THE WEIRD PART’(I) @RajohnsonAndry
  • 3. 3 / <count> FOCUS ON JAVASCRIPT « THE PROGRAMMING LANGUAGE »  LEARN HOW JAVASCRIPT WORKS UNDER THE HOOD  UNDERSTAND THINGS THAT PEOPLE WHO BUILD JQUERY UNDERSTAND  UNDERSTAND HOW POWERFULL AND BEAUTIFUL IS JAVASCRIPT
  • 4. 4 / <count> DON’T IMITATE, UNDERSTAND !  STOP LEARNING CODE BY COPYING SOME CODE ON SCREEN OR PIECE OF PAPER  FOCUS ON BASICS CONCEPTS:  SYNTHAX PARSER,  EXECUTION CONTEXT,  NAME/PAIR VALUES,  OBJECTS,  VARIABLES ,  FUNCTIONS ;
  • 5. 5 / <count> UNDERSTAND, FRAMEWORKS, AND THE WEIRD PARTS..
  • 6. 6 / <count> SYNTAX PARSER A PROGRAM THAT READS YOUR CODE AND DETERMINE WHAT IT DOES AND IF ITS GRAMMAR IS VALID. « Your code isn’t magic. Someone else wrote a program to translate it for the computer »
  • 7. 7 / <count> Your Code : Function hello() { let a = ‘Hello World’ ; } Computer Instructions Function variable
  • 8. 8 / <count> EXECUTION CONTEXT : A WRAPPER TO HELP MANAGE THE CODE THAT IS RUNNING  There are lots of lexical environnements . Which one is currently running is managed via execution contexts. It can contain things beyond what you’ve written in your code
  • 9. 9 / <count> CONCEPT OF NAME/VALUE PAIR AND OBJECTS A NAME WHICH MAPS TO A UNIQUE VALUE  The name may be defined more than one , but only can have one value in any giving context.  That value may be more name/value pair.
  • 10. 10 / <count> Address = ‘9 rue George Marette’
  • 11. 11 / <count> OBJECT : A COLLECTION OF NAME/ VALUE PAIRS The simplest definition when talking about JavaScript.
  • 12. 12 / <count> Address : { Street : ‘George Marette’, Number : 9 Appartment : { Floor : 1 Number : 201, } }
  • 13. 13 / <count> THE GLOBAL ENVIRONMENT AND THE GLOBAL OBJECT  PEOPLE : ‘ARE WE GOING TO CODE ACTUALLY ?’  ME : ‘YES !’
  • 14. Setup
  • 15. 15 / <count> Execution Context (Global) Global Object (window) ‘this’
  • 16. 16 / <count> Live coding to show you...
  • 17. 17 / <count> Execution Context Global Object « not inside a Function » ‘this’ Outer Environnent Your code
  • 18. 18 / <count> EXECUTION CONTEXT : CREATION AND ‘HOISTING’(‘hissage’ en français)
  • 19. 19 / <count> //b(); //console.log(a); var a = 'Hello World'; function b(){ console.log('called b!'); } b(); console.log(a);
  • 20. 20 / <count> Execution Context is Created (CREATION PHASE) Global Object ‘this’ Outer Environnent Setup Memory Space for Variables and Functions « Hoisting »
  • 21. 21 / <count> Variables are setup and set equal to ‘undefined’ b(); console.log(a); var a = 'Hello World'; function b() { console.log('Called b'); } // Called b // Undefined
  • 22. 22 / <count> Understanding ‘undifined’ concept in JS ? Let try out this code and see what happens : let a; console.log(a); if (a === undefined) { console.log('a is undifed!'); } else { console.log('a is defined!'); } //expected output undifined , a is undifined