SlideShare a Scribd company logo
Introduction to Javascript

            Kevin Ball
        Co-Founder & CTO

         kball@fashioningchange.com
                   @kbal11
Introduction to Javascript
Introduction to Javascript
Introduction to Javascript

• What is Javascript?
Introduction to Javascript

• What is Javascript?
• Programming Basics
Introduction to Javascript

• What is Javascript?
• Programming Basics
• HTML & the Dom
Introduction to Javascript

• What is Javascript?
• Programming Basics
• HTML & the Dom
• What makes Javascript Different
What is Javascript?
What is Javascript?
What is Javascript?

• The Language of Client-Side Web Development
What is Javascript?

• The Language of Client-Side Web Development
• Available in every browser
What is Javascript?

• The Language of Client-Side Web Development
• Available in every browser
• A Powerful Dynamic Programming Language
Web Architecture
Web Architecture
   Client/Server Model
Web Architecture
   Client/Server Model
Web Architecture
   Client/Server Model
Web Architecture
   Client/Server Model
Web Architecture
   Client/Server Model
Web Architecture
   Client/Server Model
Web Architecture
   Client/Server Model
Web Architecture
   Client/Server Model
Web Architecture
   Client/Server Model
Available in Every Browser
Available in Every Browser

• No additional tools required
Available in Every Browser

• No additional tools required
• Start playing around right away!
Browser Demo
    hello.html
Programming Basics
      Just Jump In
Programming Basics
      Just Jump In
Programming Basics
      Numbers
Programming Basics
      Numbers
Programming Basics
       Numbers


›2+2
Programming Basics
        Numbers


›2+2
==> 4
Programming Basics
              Numbers


›2+2
==> 4
› 5.0 * 0.5
Programming Basics
              Numbers


›2+2
==> 4
› 5.0 * 0.5
==> 2.5
Programming Basics
       Strings
Programming Basics
       Strings
Programming Basics
                Strings

› “Hello” + “World”;
Programming Basics
                Strings

› “Hello” + “World”;
==> “HelloWorld”
Programming Basics
                Strings

› “Hello” + “World”;
==> “HelloWorld”
› 2+ “Hello”;
Programming Basics
                Strings

› “Hello” + “World”;
==> “HelloWorld”
› 2+ “Hello”;
==> “2Hello”
Programming Basics
                    Strings

› “Hello” + “World”;
==> “HelloWorld”
› 2+ “Hello”;
==> “2Hello”
› “Hello”.length;
Programming Basics
                    Strings

› “Hello” + “World”;
==> “HelloWorld”
› 2+ “Hello”;
==> “2Hello”
› “Hello”.length;
==> 5
Programming Basics
      Variables
Programming Basics
      Variables
Programming Basics
                 Variables

› var five = 5;
Programming Basics
                 Variables

› var five = 5;
 ==> 5
Programming Basics
                 Variables

› var five = 5;
 ==> 5
› five + 10;
Programming Basics
                 Variables

› var five = 5;
 ==> 5
› five + 10;
==> 15
Programming Basics
                 Variables

› var five = 5;
 ==> 5
› five + 10;
==> 15
› five;
Programming Basics
                 Variables

› var five = 5;
 ==> 5
› five + 10;
==> 15
› five;
==> 5
Programming Basics
      Variables
Programming Basics
                Variables

› var students = 5;
Programming Basics
                Variables

› var students = 5;
==> 5
Programming Basics
               Variables

› var students = 5;
==> 5
› students = students + 10;
Programming Basics
               Variables

› var students = 5;
==> 5
› students = students + 10;
==> 15
Programming Basics
               Variables

› var students = 5;
==> 5
› students = students + 10;
==> 15
› students;
Programming Basics
               Variables

› var students = 5;
==> 5
› students = students + 10;
==> 15
› students;
==> 15
Programming Basics
       If/Then
Programming Basics
       If/Then
Programming Basics
               If/Then

var students = 5;
Programming Basics
                 If/Then

var students = 5;
if (students > 10) {
  alert(“Big Class!”);
} else {
  alert (“Small Class!”);
}
Browser Demo
   if_then.html
Programming Basics
       Loops
Programming Basics
       Loops
Programming Basics
                Loops

var students = 5;
Programming Basics
                Loops

var students = 5;
while (students <10) {
  students = students + 1;
  document.write(“More!<br/>”);
}
document.write(students + “ students”)
Browser Demo
   while.html
Programming Basics
      Functions
Programming Basics
      Functions
Programming Basics
              Functions

var plusTen = function(num) {
  return num + 10;
}
Programming Basics
               Functions

var plusTen = function(num) {
  return num + 10;
}
› var students = 5;
Programming Basics
              Functions

var plusTen = function(num) {
  return num + 10;
}
› var students = 5;
› students = plusTen(students);
Programming Basics
              Functions

var plusTen = function(num) {
  return num + 10;
}
› var students = 5;
› students = plusTen(students);
==> 15
HTML and the DOM
HTML and the DOM
HTML and the DOM
<html>
 <body>
  <h1>Hello</h1>
  <div id=‘container’>
    <p id=‘inner’>I’m in the middle!</p>
  </div>
 </body>
</html>
HTML and the DOM
Browser Demo
    dom.html
HTML and the DOM
HTML and the DOM
HTML and the DOM
DOM Manipulation
DOM Manipulation
<html>
 <body>
  <h1>Hello</h1>
  <div id=‘container’>
    <p id=‘inner’>I’m in the middle!</p>
  </div>
 </body>
</html>
DOM Manipulation
<html>
 <body>
  <h1>Hello</h1>
  <div id=‘container’>
    <p id=‘inner’>I’m in the middle!</p>
  </div>
 </body>
  <script type=”text/javascript”>
   document.getElementById(“inner”).innerHTML = “Changed!”;
 </script>
</html>
Browser Demo
 dom_manipulation.html
DOM Manipulation


  Stay Tuned for the Next Talk
Javascript: What’s Different?
Javascript: What’s Different?

  • Prototypal Inheritance
  • Closures
  • Event-based Programming
Javascript: What’s Different?
           Inheritance
Javascript: What’s Different?
                    Inheritance

Traditional Inheritance
Javascript: What’s Different?
                    Inheritance

Traditional Inheritance

         Shape
Javascript: What’s Different?
                    Inheritance

Traditional Inheritance

         Shape
Javascript: What’s Different?
                    Inheritance

Traditional Inheritance

            Shape




   Square
Javascript: What’s Different?
                    Inheritance

Traditional Inheritance

            Shape




   Square
Javascript: What’s Different?
                         Inheritance

Traditional Inheritance

            Shape




   Square
                    Triangle
Javascript: What’s Different?
                         Inheritance

Traditional Inheritance          Prototypal Inheritance

            Shape




   Square
                    Triangle
Javascript: What’s Different?
                         Inheritance

Traditional Inheritance          Prototypal Inheritance

            Shape                       This
                                       Square




   Square
                    Triangle
Javascript: What’s Different?
                         Inheritance

Traditional Inheritance          Prototypal Inheritance

            Shape                       This
                                       Square




   Square
                    Triangle
Javascript: What’s Different?
                         Inheritance

Traditional Inheritance          Prototypal Inheritance

            Shape                       This
                                       Square



                                        Copy
   Square
                    Triangle           Square
Javascript: What’s Different?
                         Inheritance

Traditional Inheritance          Prototypal Inheritance

            Shape                       This
                                       Square




   Square
                    Triangle           Triangle
Javascript: What’s Different?
           Closures
Javascript: What’s Different?
           Closures
Javascript: What’s Different?
                  Closures

    var students = 5;
Javascript: What’s Different?
                  Closures

    var students = 5;
   var howManyStudents = function() {
     return students;
   }
   howManyStudents();
Javascript: What’s Different?
                  Closures

    var students = 5;
   var howManyStudents = function() {
     return students;
   }
   howManyStudents();
   ==> 5
Javascript: What’s Different?
       Event Based Programming
Javascript: What’s Different?
                 Event Based Programming
<html>
 <body>
  <h1 id=‘clickable’>Click Me</h1>
 </body>
  <script type=”text/javascript”>
   var clickFn = function() {alert(“Clicked!”);}
   document.getElementById(“clickable”).onclick = clickFn;
 </script>
</html>
Browser Demo
    click.html
Resources

• CodeAcademy (codeacademy.com)
• Douglass Crockford Videos (http://
  www.yuiblog.com/crockford/)
• Book: JavaScript, The Good Parts (Douglass
  Crockford)
Questions?
Thank You

    Kevin Ball
Co-Founder & CTO

 kball@fashioningchange.com
           @kbal11

More Related Content

PDF
Why you should be excited about ClojureScript
elliando dias
 
PDF
Polyglot and Poly-paradigm Programming for Better Agility
elliando dias
 
PDF
Javascript toolkit
Marcos Vinícius
 
PDF
What if-your-application-could-speak
Marcos Vinícius
 
PPTX
JavaScript - Intro
Anton Tibblin
 
PDF
Intro to JavaScript
Dan Phiffer
 
PDF
Intro to JavaScript
Yakov Fain
 
PDF
NodeJs Intro - JavaScript Zagreb Meetup #1
Tomislav Capan
 
Why you should be excited about ClojureScript
elliando dias
 
Polyglot and Poly-paradigm Programming for Better Agility
elliando dias
 
Javascript toolkit
Marcos Vinícius
 
What if-your-application-could-speak
Marcos Vinícius
 
JavaScript - Intro
Anton Tibblin
 
Intro to JavaScript
Dan Phiffer
 
Intro to JavaScript
Yakov Fain
 
NodeJs Intro - JavaScript Zagreb Meetup #1
Tomislav Capan
 

Viewers also liked (15)

PDF
Intro to JavaScript
Jussi Pohjolainen
 
PPTX
Intro to Javascript
Anjan Banda
 
PDF
Intro to javascript (4 week)
Jamal Sinclair O'Garro
 
PDF
Intro to JavaScript
Alessandro Muraro
 
PDF
Javascript intro for MAH
Aleksander Fabijan
 
PDF
JavaScript Intro
Eric Brown
 
PPT
Javascript Intro 01
vikram singh
 
PDF
Intro to Javascript and jQuery
Shawn Calvert
 
PDF
Basics of JavaScript
Bala Narayanan
 
PDF
Le Wagon - Javascript for Beginners
Sébastien Saunier
 
PDF
Fundamental JavaScript [UTC, March 2014]
Aaron Gustafson
 
PDF
Introduction to JavaScript
Bryan Basham
 
PPT
Introduction to Javascript
Amit Tyagi
 
PPT
Javascript
guest03a6e6
 
PPT
JavaScript - An Introduction
Manvendra Singh
 
Intro to JavaScript
Jussi Pohjolainen
 
Intro to Javascript
Anjan Banda
 
Intro to javascript (4 week)
Jamal Sinclair O'Garro
 
Intro to JavaScript
Alessandro Muraro
 
Javascript intro for MAH
Aleksander Fabijan
 
JavaScript Intro
Eric Brown
 
Javascript Intro 01
vikram singh
 
Intro to Javascript and jQuery
Shawn Calvert
 
Basics of JavaScript
Bala Narayanan
 
Le Wagon - Javascript for Beginners
Sébastien Saunier
 
Fundamental JavaScript [UTC, March 2014]
Aaron Gustafson
 
Introduction to JavaScript
Bryan Basham
 
Introduction to Javascript
Amit Tyagi
 
Javascript
guest03a6e6
 
JavaScript - An Introduction
Manvendra Singh
 
Ad

Similar to Intro to Javascript (20)

PDF
slides-students-C03.pdf
HARDIKGUPTAMCO21373
 
KEY
JavaScript For People Who Don't Code
Christopher Schmitt
 
PDF
Leveling Up at JavaScript
Raymond Camden
 
PDF
Gwt create2013 Frankfurt: How we built a million dollar business with GWT
infoqafe
 
KEY
About Clack
fukamachi
 
PDF
Java script core
Vaishnu Vaishu
 
PPTX
Enterprise JavaScript ... what the heck?
Nedelcho Delchev
 
PDF
Quo vadis, JavaScript? Devday.pl keynote
Christian Heilmann
 
PPTX
Breaking the oracle tie
agiamas
 
PDF
Lecture7
Majid Taghiloo
 
PPTX
ELAG Workshop version 1
Karsten Kryger Hansen
 
PPTX
Wintellect - Devscovery - Enterprise JavaScript Development 1 of 2
Jeremy Likness
 
PPTX
Groovy And Grails Introduction
Eric Weimer
 
PDF
wt mod3.pdf
VinayKumarV24
 
PDF
Let’s learn how to use JavaScript responsibly and stay up-to-date.
Christian Heilmann
 
PPTX
WT Module-3.pptx
RamyaH11
 
PPT
Domain Specific Languages
Wee Witthawaskul
 
PPTX
There Is No JavaScript
Noam Kfir
 
PPTX
Noam Kfir - There is no Java Script - code.talks 2015
AboutYouGmbH
 
PDF
Software Engineering Thailand: Programming with Scala
Brian Topping
 
slides-students-C03.pdf
HARDIKGUPTAMCO21373
 
JavaScript For People Who Don't Code
Christopher Schmitt
 
Leveling Up at JavaScript
Raymond Camden
 
Gwt create2013 Frankfurt: How we built a million dollar business with GWT
infoqafe
 
About Clack
fukamachi
 
Java script core
Vaishnu Vaishu
 
Enterprise JavaScript ... what the heck?
Nedelcho Delchev
 
Quo vadis, JavaScript? Devday.pl keynote
Christian Heilmann
 
Breaking the oracle tie
agiamas
 
Lecture7
Majid Taghiloo
 
ELAG Workshop version 1
Karsten Kryger Hansen
 
Wintellect - Devscovery - Enterprise JavaScript Development 1 of 2
Jeremy Likness
 
Groovy And Grails Introduction
Eric Weimer
 
wt mod3.pdf
VinayKumarV24
 
Let’s learn how to use JavaScript responsibly and stay up-to-date.
Christian Heilmann
 
WT Module-3.pptx
RamyaH11
 
Domain Specific Languages
Wee Witthawaskul
 
There Is No JavaScript
Noam Kfir
 
Noam Kfir - There is no Java Script - code.talks 2015
AboutYouGmbH
 
Software Engineering Thailand: Programming with Scala
Brian Topping
 
Ad

More from Kevin Ball (7)

PDF
Flexible UI Components for a Multi-Framework World
Kevin Ball
 
PDF
Modern javascript
Kevin Ball
 
PDF
Npm Shrinkwrap
Kevin Ball
 
PDF
Understanding the Nesting Structure of the Ember.js View Layer
Kevin Ball
 
KEY
Underscore.js
Kevin Ball
 
PDF
Omniauth: Future Proof Your Authentication
Kevin Ball
 
KEY
Ruby 1.9 Fibers
Kevin Ball
 
Flexible UI Components for a Multi-Framework World
Kevin Ball
 
Modern javascript
Kevin Ball
 
Npm Shrinkwrap
Kevin Ball
 
Understanding the Nesting Structure of the Ember.js View Layer
Kevin Ball
 
Underscore.js
Kevin Ball
 
Omniauth: Future Proof Your Authentication
Kevin Ball
 
Ruby 1.9 Fibers
Kevin Ball
 

Recently uploaded (20)

PPTX
Comunidade Salesforce São Paulo - Desmistificando o Omnistudio (Vlocity)
Francisco Vieira Júnior
 
PPTX
Smart Infrastructure and Automation through IoT Sensors
Rejig Digital
 
PDF
A Day in the Life of Location Data - Turning Where into How.pdf
Precisely
 
PDF
Presentation about Hardware and Software in Computer
snehamodhawadiya
 
PDF
Software Development Company | KodekX
KodekX
 
PDF
Tea4chat - another LLM Project by Kerem Atam
a0m0rajab1
 
PDF
Cloud-Migration-Best-Practices-A-Practical-Guide-to-AWS-Azure-and-Google-Clou...
Artjoker Software Development Company
 
PDF
Chapter 1 Introduction to CV and IP Lecture Note.pdf
Getnet Tigabie Askale -(GM)
 
PDF
Orbitly Pitch Deck|A Mission-Driven Platform for Side Project Collaboration (...
zz41354899
 
PDF
Structs to JSON: How Go Powers REST APIs
Emily Achieng
 
PDF
Software Development Methodologies in 2025
KodekX
 
PPT
L2 Rules of Netiquette in Empowerment technology
Archibal2
 
PPTX
cloud computing vai.pptx for the project
vaibhavdobariyal79
 
PDF
Best ERP System for Manufacturing in India | Elite Mindz
Elite Mindz
 
PDF
Revolutionize Operations with Intelligent IoT Monitoring and Control
Rejig Digital
 
PPTX
The-Ethical-Hackers-Imperative-Safeguarding-the-Digital-Frontier.pptx
sujalchauhan1305
 
PPTX
Stamford - Community User Group Leaders_ Agentblazer Status, AI Sustainabilit...
Amol Dixit
 
PDF
Unlocking the Future- AI Agents Meet Oracle Database 23ai - AIOUG Yatra 2025.pdf
Sandesh Rao
 
PDF
Oracle AI Vector Search- Getting Started and what's new in 2025- AIOUG Yatra ...
Sandesh Rao
 
PPTX
OA presentation.pptx OA presentation.pptx
pateldhruv002338
 
Comunidade Salesforce São Paulo - Desmistificando o Omnistudio (Vlocity)
Francisco Vieira Júnior
 
Smart Infrastructure and Automation through IoT Sensors
Rejig Digital
 
A Day in the Life of Location Data - Turning Where into How.pdf
Precisely
 
Presentation about Hardware and Software in Computer
snehamodhawadiya
 
Software Development Company | KodekX
KodekX
 
Tea4chat - another LLM Project by Kerem Atam
a0m0rajab1
 
Cloud-Migration-Best-Practices-A-Practical-Guide-to-AWS-Azure-and-Google-Clou...
Artjoker Software Development Company
 
Chapter 1 Introduction to CV and IP Lecture Note.pdf
Getnet Tigabie Askale -(GM)
 
Orbitly Pitch Deck|A Mission-Driven Platform for Side Project Collaboration (...
zz41354899
 
Structs to JSON: How Go Powers REST APIs
Emily Achieng
 
Software Development Methodologies in 2025
KodekX
 
L2 Rules of Netiquette in Empowerment technology
Archibal2
 
cloud computing vai.pptx for the project
vaibhavdobariyal79
 
Best ERP System for Manufacturing in India | Elite Mindz
Elite Mindz
 
Revolutionize Operations with Intelligent IoT Monitoring and Control
Rejig Digital
 
The-Ethical-Hackers-Imperative-Safeguarding-the-Digital-Frontier.pptx
sujalchauhan1305
 
Stamford - Community User Group Leaders_ Agentblazer Status, AI Sustainabilit...
Amol Dixit
 
Unlocking the Future- AI Agents Meet Oracle Database 23ai - AIOUG Yatra 2025.pdf
Sandesh Rao
 
Oracle AI Vector Search- Getting Started and what's new in 2025- AIOUG Yatra ...
Sandesh Rao
 
OA presentation.pptx OA presentation.pptx
pateldhruv002338
 

Intro to Javascript

Editor's Notes