SlideShare a Scribd company logo
JavaScript
                        The Ubiquitous Language
Friday, June 24, 2011
What Is It?

                            How Can I Use It?




                                                JavaScript

                                                             Why Should I Care?

                        How Does It Work?




Friday, June 24, 2011
What Is JavaScript?
                        A quick survey of what it is and isn't.




Friday, June 24, 2011
Influences
           • Invented by Brendan Eich in 1995
           • Initially no one took it seriously
           • Resembles the earlier NewtonScript in many ways
           • Designed to work well within a constrained
                environment

           • "Feels" a little like Python, but different, too
           • C inspired syntax
Friday, June 24, 2011
What's In A Name?

           • Mocha, LiveScript, &
               EcmaScript
                                     YES

           • JScript & ActiveScript SORT OF
           • JQuery            NOT REALLY
           • Java                     NO
           • The "J" in both AJaX and JSON


Friday, June 24, 2011
Present Realities
           • Not just for browsers.
                • It's a full-featured, general-purpose language.
           • It's a modern interpreted language.
                • Good support for object-oriented paradigms.
                • Also good support for functional programming.
                • And even aspect-oriented or genetic programming.
Friday, June 24, 2011
Why JavaScript?
                        Why should I learn this thing anyway?




Friday, June 24, 2011
It's Ubiquitous
           • Its rough start kept it from being a target, and it had
                time to spread everywhere.

           • Historically it is unmatched.
           • It's on every mainstream browser.
           • There are many stand-alone engines.
           • There are a handful of server-side systems.
           • It's even embedded in things like PDF and Flash.
Friday, June 24, 2011
The Browser Situation
           • Fighting for the top spot:
             • Chrome
             • Safari
             • Firefox
           • Also quite good:
             • Opera
           • It exists:
             • Microsoft Internet Explorer

Friday, June 24, 2011
The Open Engine Situation
           • Also driven by competition.
           • Three contenders for top spot:
             • V8
             • JavaScriptCore
             • SpiderMonkey
           • Other options are available:
             • Rhino
             • K7

Friday, June 24, 2011
The Server Situation
           • Less competitive than browsers
               and engines.

           • All rely on the open engines.
           • One big player:
             • Node
           • Others of note:
             • Narwhal
             • Flusspferd

Friday, June 24, 2011
The Toolkit Situation
           • Many frameworks and toolkits
               are built on top of JavaScript:

                • Dojo
                • JQuery
                • Prototype
                • MooTools
                • YUI
                • ExtJS

Friday, June 24, 2011
The Overall Situation
           • Initially seen as a toy, it was left alone and it matured.
           • Many modern implementations do JIT compilation.
           • It's already quite fast and efficient.
           • Several big companies have stakes in it.
           • It's driven by competition and getting better & better.
           • It's poised to become the most popular computer
                language the world has yet seen.

Friday, June 24, 2011
What’s the Syntax Like?
                        What are the technical details of the language?




Friday, June 24, 2011
The Basics

           • Operators, loops, and
               conditionals similar to C

           • But, variables are dynamically
               typed

           • "Optional" semicolons (never
               omit them)

           • "Optional" var keyword (never
               omit it)




Friday, June 24, 2011
Simple Variable Types
           • Booleans
           • Numbers
           • Predefined constants:
             • true
             • false
             • undefined
             • Infinity
             •NaN


Friday, June 24, 2011
Arrays
           • Used for holding ordered items.
           • Items need not be of the same
               type or even scalar.

           • Indexing syntax works as
               expected and is zero-based:
               a[1]=1 for [0,1,true]

           • A length property is
               maintained: a.length is 3.

           • Not for associative arrays.

Friday, June 24, 2011
Text
           • Strings
             • Similar to arrays
             • Many built-in methods
             • Literals: 'val' and "val"
           • Regular Expressions
             • Support most popular
                    expressions

                • Literals: /pattern/flags

Friday, June 24, 2011
Objects
           • Used for holding named items.
           • Items need not be of the same
               type or even scalar.

           • Item keys don't need quotes.
           • Support array indexing.
           • Use for associative arrays.
           • Predefined sentinel null is
               distinct from {}.



Friday, June 24, 2011
Dates

           • JavaScript provides a pre-
               defined Date object.

           • It holds a full timestamp, not
               just a date.

           • It supports a few different
               constructor signatures.

           • It features lots of methods to
               work with individual parts.




Friday, June 24, 2011
Math
           • The global Math object provides
               many basic mathematical functions
               and constants.

           • Math.abs, Math.ceil,
               Math.floor, Math.round,
               Math.log, Math.exp, Math.max,
               Math.min, Math.sin, Math.cos,
               Math.tan, Math.sqrt,
               Math.random, etc.

           • Math.PI, Math.E, Math.SQRT2,
               Math.LN2, Math.LN10, etc.



Friday, June 24, 2011
Functions
           • Functions are full-class citizens in JavaScript.
           • Functions can be passed into other functions.
           • Functions can return functions.
           • Partials, curries, closures, etc. are all good.
           • Anonymous functions are fine.
           • Functional programming, à la LISP, but without all
                the parentheses.

Friday, June 24, 2011
Friday, June 24, 2011
Scope
           • Scope is defined only by
               function blocks.

           • Closures can sometimes be
               surprising to those not used to
               them.

           • Anonymous functions are often
               used to control scope.

           • Enclosing scopes are also
               searched.



Friday, June 24, 2011
Objects Revisited
           • The combination of first-class
               functions and associative arrays
               leads to "real" objects.

           • Members may be public or
               private.

           • All JavaScript objects inherit
               from a base Object.

           • Object inheritance is a little
               different from what may be
               familiar...



Friday, June 24, 2011
Inheritance
           • JavaScript uses differential
               inheritance (a variation of
               prototypal inheritance)

           • There are no classes.
           • No "protected" equivalent.
           • Objects inherit from similar
               objects and declare differences.

           • Links to prototypes are
               preserved.



Friday, June 24, 2011
How Does One Use
                            JavaScript?
                        What about debuggers and environments?




Friday, June 24, 2011
Different Environments,
                           Different Debuggers
           • All the command-line examples in this presentation
                were entered live into node.

           • It can also be used for running scripts.
           • Most modern browsers also have their own
                environments for inspecting JavaScript and even
                trying code live.

           • These environments vary greatly in quality; in
                particular, don't expect too much in the mobile world.

Friday, June 24, 2011
Firefox (Firebug)




                         The first really good offering.

Friday, June 24, 2011
Safari & Chrome
                               (Web Inspector)




                        Keeps pressure on Firefox & Firebug.

Friday, June 24, 2011
Opera (Dragonfly)




Friday, June 24, 2011
MSIE (Developer Tools)




               First packaged with version 8. The Developer Toolbar
                           is available for prior versions.
Friday, June 24, 2011
Where Can I Learn
                             More?
                        A short list of selected references.




Friday, June 24, 2011
A Few Sites of Interest
           • shouldilearnjavascript.com
           • developer.mozilla.org/en/JavaScript
           • dojotoolkit.org
           • nodejs.org
           • npmjs.org
           • getfirebug.com
           • trac.webkit.org/wiki/WebInspector
           • opera.com/dragonfly/
           • msdn.microsoft.com/library/dd565622


Friday, June 24, 2011

More Related Content

Viewers also liked

NodeJs Intro - JavaScript Zagreb Meetup #1
NodeJs Intro - JavaScript Zagreb Meetup #1NodeJs Intro - JavaScript Zagreb Meetup #1
NodeJs Intro - JavaScript Zagreb Meetup #1Tomislav Capan
 
Intro to javascript (4 week)
Intro to javascript (4 week)Intro to javascript (4 week)
Intro to javascript (4 week)
Jamal Sinclair O'Garro
 
Math functions in javascript
Math functions in javascriptMath functions in javascript
Javascript intro for MAH
Javascript intro for MAHJavascript intro for MAH
Javascript intro for MAH
Aleksander Fabijan
 
Intro to Javascript
Intro to JavascriptIntro to Javascript
Intro to JavascriptKevin Ball
 
JavaScript - Intro
JavaScript - IntroJavaScript - Intro
JavaScript - Intro
Anton Tibblin
 
Intro to Javascript and jQuery
Intro to Javascript and jQueryIntro to Javascript and jQuery
Intro to Javascript and jQueryShawn Calvert
 
Intro to JavaScript
Intro to JavaScriptIntro to JavaScript
Intro to JavaScript
Dan Phiffer
 
Intro to JavaScript
Intro to JavaScriptIntro to JavaScript
Intro to JavaScript
Yakov Fain
 
बेसिक जावा प्रोग्रामिंग हिंदी में
बेसिक जावा प्रोग्रामिंग हिंदी में बेसिक जावा प्रोग्रामिंग हिंदी में
बेसिक जावा प्रोग्रामिंग हिंदी में
Chand Rook
 

Viewers also liked (11)

NodeJs Intro - JavaScript Zagreb Meetup #1
NodeJs Intro - JavaScript Zagreb Meetup #1NodeJs Intro - JavaScript Zagreb Meetup #1
NodeJs Intro - JavaScript Zagreb Meetup #1
 
Intro to JavaScript
Intro to JavaScriptIntro to JavaScript
Intro to JavaScript
 
Intro to javascript (4 week)
Intro to javascript (4 week)Intro to javascript (4 week)
Intro to javascript (4 week)
 
Math functions in javascript
Math functions in javascriptMath functions in javascript
Math functions in javascript
 
Javascript intro for MAH
Javascript intro for MAHJavascript intro for MAH
Javascript intro for MAH
 
Intro to Javascript
Intro to JavascriptIntro to Javascript
Intro to Javascript
 
JavaScript - Intro
JavaScript - IntroJavaScript - Intro
JavaScript - Intro
 
Intro to Javascript and jQuery
Intro to Javascript and jQueryIntro to Javascript and jQuery
Intro to Javascript and jQuery
 
Intro to JavaScript
Intro to JavaScriptIntro to JavaScript
Intro to JavaScript
 
Intro to JavaScript
Intro to JavaScriptIntro to JavaScript
Intro to JavaScript
 
बेसिक जावा प्रोग्रामिंग हिंदी में
बेसिक जावा प्रोग्रामिंग हिंदी में बेसिक जावा प्रोग्रामिंग हिंदी में
बेसिक जावा प्रोग्रामिंग हिंदी में
 

Similar to JavaScript Intro

Hunspell4Eclipse-democamps-grenoble-2011
Hunspell4Eclipse-democamps-grenoble-2011Hunspell4Eclipse-democamps-grenoble-2011
Hunspell4Eclipse-democamps-grenoble-2011
olivier gattaz
 
JVM for Dummies - OSCON 2011
JVM for Dummies - OSCON 2011JVM for Dummies - OSCON 2011
JVM for Dummies - OSCON 2011Charles Nutter
 
The Game Of Life - Java‘s Siblings and Heirs are populating the Ecosystem
The Game Of Life - Java‘s Siblings and Heirs are populating  the EcosystemThe Game Of Life - Java‘s Siblings and Heirs are populating  the Ecosystem
The Game Of Life - Java‘s Siblings and Heirs are populating the Ecosystem
jexp
 
Object oriented javascript
Object oriented javascriptObject oriented javascript
Object oriented javascriptGarrison Locke
 
TypeScript 1.6 - How I learned to Stop Worrying and Love JavaScript
TypeScript 1.6 - How I learned to Stop Worrying and Love JavaScriptTypeScript 1.6 - How I learned to Stop Worrying and Love JavaScript
TypeScript 1.6 - How I learned to Stop Worrying and Love JavaScript
Wekoslav Stefanovski
 
Introducing the Ceylon Project - Gavin King presentation at QCon Beijing 2011
Introducing the Ceylon Project - Gavin King presentation at QCon Beijing 2011Introducing the Ceylon Project - Gavin King presentation at QCon Beijing 2011
Introducing the Ceylon Project - Gavin King presentation at QCon Beijing 2011
devstonez
 
groovy & grails - lecture 1
groovy & grails - lecture 1groovy & grails - lecture 1
groovy & grails - lecture 1
Alexandre Masselot
 
Zero to Hero in Machine Learning with Keras
Zero to Hero in Machine Learning with KerasZero to Hero in Machine Learning with Keras
Zero to Hero in Machine Learning with Keras
Boris Yakubchik
 
Jazeed about Solr - People as A Search Problem
Jazeed about Solr - People as A Search ProblemJazeed about Solr - People as A Search Problem
Jazeed about Solr - People as A Search ProblemLucidworks (Archived)
 
Jazzed about Solr: People as a Search Problem - By Joshua Tuberville
Jazzed about Solr: People as a Search Problem - By Joshua TubervilleJazzed about Solr: People as a Search Problem - By Joshua Tuberville
Jazzed about Solr: People as a Search Problem - By Joshua Tuberville
lucenerevolution
 
A Quick Tour of JVM Languages
A Quick Tour of JVM LanguagesA Quick Tour of JVM Languages
A Quick Tour of JVM Languages
Stefane Fermigier
 
Sean coates fifty things and tricks, confoo 2011
Sean coates fifty things and tricks, confoo 2011Sean coates fifty things and tricks, confoo 2011
Sean coates fifty things and tricks, confoo 2011Bachkoutou Toutou
 
AObench with Emscripten
AObench with EmscriptenAObench with Emscripten
AObench with EmscriptenSyoyo Fujita
 
Are High Level Programming Languages for Multicore and Safety Critical Conver...
Are High Level Programming Languages for Multicore and Safety Critical Conver...Are High Level Programming Languages for Multicore and Safety Critical Conver...
Are High Level Programming Languages for Multicore and Safety Critical Conver...
InfinIT - Innovationsnetværket for it
 
Building OBO Foundry ontology using semantic web tools
Building OBO Foundry ontology using semantic web toolsBuilding OBO Foundry ontology using semantic web tools
Building OBO Foundry ontology using semantic web tools
Melanie Courtot
 
javerosmx-2015-marzo-groovy-java8-comparison
javerosmx-2015-marzo-groovy-java8-comparisonjaverosmx-2015-marzo-groovy-java8-comparison
javerosmx-2015-marzo-groovy-java8-comparison
Domingo Suarez Torres
 
sete linguagens em sete semanas
sete linguagens em sete semanassete linguagens em sete semanas
sete linguagens em sete semanas
tdc-globalcode
 
There Is No JavaScript
There Is No JavaScriptThere Is No JavaScript
There Is No JavaScript
Noam Kfir
 
Noam Kfir - There is no Java Script - code.talks 2015
Noam Kfir - There is no Java Script - code.talks 2015Noam Kfir - There is no Java Script - code.talks 2015
Noam Kfir - There is no Java Script - code.talks 2015
AboutYouGmbH
 
3 years with Clojure
3 years with Clojure3 years with Clojure
3 years with Clojure
Michael Klishin
 

Similar to JavaScript Intro (20)

Hunspell4Eclipse-democamps-grenoble-2011
Hunspell4Eclipse-democamps-grenoble-2011Hunspell4Eclipse-democamps-grenoble-2011
Hunspell4Eclipse-democamps-grenoble-2011
 
JVM for Dummies - OSCON 2011
JVM for Dummies - OSCON 2011JVM for Dummies - OSCON 2011
JVM for Dummies - OSCON 2011
 
The Game Of Life - Java‘s Siblings and Heirs are populating the Ecosystem
The Game Of Life - Java‘s Siblings and Heirs are populating  the EcosystemThe Game Of Life - Java‘s Siblings and Heirs are populating  the Ecosystem
The Game Of Life - Java‘s Siblings and Heirs are populating the Ecosystem
 
Object oriented javascript
Object oriented javascriptObject oriented javascript
Object oriented javascript
 
TypeScript 1.6 - How I learned to Stop Worrying and Love JavaScript
TypeScript 1.6 - How I learned to Stop Worrying and Love JavaScriptTypeScript 1.6 - How I learned to Stop Worrying and Love JavaScript
TypeScript 1.6 - How I learned to Stop Worrying and Love JavaScript
 
Introducing the Ceylon Project - Gavin King presentation at QCon Beijing 2011
Introducing the Ceylon Project - Gavin King presentation at QCon Beijing 2011Introducing the Ceylon Project - Gavin King presentation at QCon Beijing 2011
Introducing the Ceylon Project - Gavin King presentation at QCon Beijing 2011
 
groovy & grails - lecture 1
groovy & grails - lecture 1groovy & grails - lecture 1
groovy & grails - lecture 1
 
Zero to Hero in Machine Learning with Keras
Zero to Hero in Machine Learning with KerasZero to Hero in Machine Learning with Keras
Zero to Hero in Machine Learning with Keras
 
Jazeed about Solr - People as A Search Problem
Jazeed about Solr - People as A Search ProblemJazeed about Solr - People as A Search Problem
Jazeed about Solr - People as A Search Problem
 
Jazzed about Solr: People as a Search Problem - By Joshua Tuberville
Jazzed about Solr: People as a Search Problem - By Joshua TubervilleJazzed about Solr: People as a Search Problem - By Joshua Tuberville
Jazzed about Solr: People as a Search Problem - By Joshua Tuberville
 
A Quick Tour of JVM Languages
A Quick Tour of JVM LanguagesA Quick Tour of JVM Languages
A Quick Tour of JVM Languages
 
Sean coates fifty things and tricks, confoo 2011
Sean coates fifty things and tricks, confoo 2011Sean coates fifty things and tricks, confoo 2011
Sean coates fifty things and tricks, confoo 2011
 
AObench with Emscripten
AObench with EmscriptenAObench with Emscripten
AObench with Emscripten
 
Are High Level Programming Languages for Multicore and Safety Critical Conver...
Are High Level Programming Languages for Multicore and Safety Critical Conver...Are High Level Programming Languages for Multicore and Safety Critical Conver...
Are High Level Programming Languages for Multicore and Safety Critical Conver...
 
Building OBO Foundry ontology using semantic web tools
Building OBO Foundry ontology using semantic web toolsBuilding OBO Foundry ontology using semantic web tools
Building OBO Foundry ontology using semantic web tools
 
javerosmx-2015-marzo-groovy-java8-comparison
javerosmx-2015-marzo-groovy-java8-comparisonjaverosmx-2015-marzo-groovy-java8-comparison
javerosmx-2015-marzo-groovy-java8-comparison
 
sete linguagens em sete semanas
sete linguagens em sete semanassete linguagens em sete semanas
sete linguagens em sete semanas
 
There Is No JavaScript
There Is No JavaScriptThere Is No JavaScript
There Is No JavaScript
 
Noam Kfir - There is no Java Script - code.talks 2015
Noam Kfir - There is no Java Script - code.talks 2015Noam Kfir - There is no Java Script - code.talks 2015
Noam Kfir - There is no Java Script - code.talks 2015
 
3 years with Clojure
3 years with Clojure3 years with Clojure
3 years with Clojure
 

Recently uploaded

UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
Bhaskar Mitra
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Tobias Schneck
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
DianaGray10
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Inflectra
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Thierry Lestable
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
Ralf Eggert
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
CatarinaPereira64715
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
Product School
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
Product School
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 

Recently uploaded (20)

UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 

JavaScript Intro

  • 1. JavaScript The Ubiquitous Language Friday, June 24, 2011
  • 2. What Is It? How Can I Use It? JavaScript Why Should I Care? How Does It Work? Friday, June 24, 2011
  • 3. What Is JavaScript? A quick survey of what it is and isn't. Friday, June 24, 2011
  • 4. Influences • Invented by Brendan Eich in 1995 • Initially no one took it seriously • Resembles the earlier NewtonScript in many ways • Designed to work well within a constrained environment • "Feels" a little like Python, but different, too • C inspired syntax Friday, June 24, 2011
  • 5. What's In A Name? • Mocha, LiveScript, & EcmaScript YES • JScript & ActiveScript SORT OF • JQuery NOT REALLY • Java NO • The "J" in both AJaX and JSON Friday, June 24, 2011
  • 6. Present Realities • Not just for browsers. • It's a full-featured, general-purpose language. • It's a modern interpreted language. • Good support for object-oriented paradigms. • Also good support for functional programming. • And even aspect-oriented or genetic programming. Friday, June 24, 2011
  • 7. Why JavaScript? Why should I learn this thing anyway? Friday, June 24, 2011
  • 8. It's Ubiquitous • Its rough start kept it from being a target, and it had time to spread everywhere. • Historically it is unmatched. • It's on every mainstream browser. • There are many stand-alone engines. • There are a handful of server-side systems. • It's even embedded in things like PDF and Flash. Friday, June 24, 2011
  • 9. The Browser Situation • Fighting for the top spot: • Chrome • Safari • Firefox • Also quite good: • Opera • It exists: • Microsoft Internet Explorer Friday, June 24, 2011
  • 10. The Open Engine Situation • Also driven by competition. • Three contenders for top spot: • V8 • JavaScriptCore • SpiderMonkey • Other options are available: • Rhino • K7 Friday, June 24, 2011
  • 11. The Server Situation • Less competitive than browsers and engines. • All rely on the open engines. • One big player: • Node • Others of note: • Narwhal • Flusspferd Friday, June 24, 2011
  • 12. The Toolkit Situation • Many frameworks and toolkits are built on top of JavaScript: • Dojo • JQuery • Prototype • MooTools • YUI • ExtJS Friday, June 24, 2011
  • 13. The Overall Situation • Initially seen as a toy, it was left alone and it matured. • Many modern implementations do JIT compilation. • It's already quite fast and efficient. • Several big companies have stakes in it. • It's driven by competition and getting better & better. • It's poised to become the most popular computer language the world has yet seen. Friday, June 24, 2011
  • 14. What’s the Syntax Like? What are the technical details of the language? Friday, June 24, 2011
  • 15. The Basics • Operators, loops, and conditionals similar to C • But, variables are dynamically typed • "Optional" semicolons (never omit them) • "Optional" var keyword (never omit it) Friday, June 24, 2011
  • 16. Simple Variable Types • Booleans • Numbers • Predefined constants: • true • false • undefined • Infinity •NaN Friday, June 24, 2011
  • 17. Arrays • Used for holding ordered items. • Items need not be of the same type or even scalar. • Indexing syntax works as expected and is zero-based: a[1]=1 for [0,1,true] • A length property is maintained: a.length is 3. • Not for associative arrays. Friday, June 24, 2011
  • 18. Text • Strings • Similar to arrays • Many built-in methods • Literals: 'val' and "val" • Regular Expressions • Support most popular expressions • Literals: /pattern/flags Friday, June 24, 2011
  • 19. Objects • Used for holding named items. • Items need not be of the same type or even scalar. • Item keys don't need quotes. • Support array indexing. • Use for associative arrays. • Predefined sentinel null is distinct from {}. Friday, June 24, 2011
  • 20. Dates • JavaScript provides a pre- defined Date object. • It holds a full timestamp, not just a date. • It supports a few different constructor signatures. • It features lots of methods to work with individual parts. Friday, June 24, 2011
  • 21. Math • The global Math object provides many basic mathematical functions and constants. • Math.abs, Math.ceil, Math.floor, Math.round, Math.log, Math.exp, Math.max, Math.min, Math.sin, Math.cos, Math.tan, Math.sqrt, Math.random, etc. • Math.PI, Math.E, Math.SQRT2, Math.LN2, Math.LN10, etc. Friday, June 24, 2011
  • 22. Functions • Functions are full-class citizens in JavaScript. • Functions can be passed into other functions. • Functions can return functions. • Partials, curries, closures, etc. are all good. • Anonymous functions are fine. • Functional programming, à la LISP, but without all the parentheses. Friday, June 24, 2011
  • 24. Scope • Scope is defined only by function blocks. • Closures can sometimes be surprising to those not used to them. • Anonymous functions are often used to control scope. • Enclosing scopes are also searched. Friday, June 24, 2011
  • 25. Objects Revisited • The combination of first-class functions and associative arrays leads to "real" objects. • Members may be public or private. • All JavaScript objects inherit from a base Object. • Object inheritance is a little different from what may be familiar... Friday, June 24, 2011
  • 26. Inheritance • JavaScript uses differential inheritance (a variation of prototypal inheritance) • There are no classes. • No "protected" equivalent. • Objects inherit from similar objects and declare differences. • Links to prototypes are preserved. Friday, June 24, 2011
  • 27. How Does One Use JavaScript? What about debuggers and environments? Friday, June 24, 2011
  • 28. Different Environments, Different Debuggers • All the command-line examples in this presentation were entered live into node. • It can also be used for running scripts. • Most modern browsers also have their own environments for inspecting JavaScript and even trying code live. • These environments vary greatly in quality; in particular, don't expect too much in the mobile world. Friday, June 24, 2011
  • 29. Firefox (Firebug) The first really good offering. Friday, June 24, 2011
  • 30. Safari & Chrome (Web Inspector) Keeps pressure on Firefox & Firebug. Friday, June 24, 2011
  • 32. MSIE (Developer Tools) First packaged with version 8. The Developer Toolbar is available for prior versions. Friday, June 24, 2011
  • 33. Where Can I Learn More? A short list of selected references. Friday, June 24, 2011
  • 34. A Few Sites of Interest • shouldilearnjavascript.com • developer.mozilla.org/en/JavaScript • dojotoolkit.org • nodejs.org • npmjs.org • getfirebug.com • trac.webkit.org/wiki/WebInspector • opera.com/dragonfly/ • msdn.microsoft.com/library/dd565622 Friday, June 24, 2011