Javascript
The Basics

WOODIWISS.ME

Freelance Web Developer & Lecturer
in the Winchester, Hampshire area.
What’s covered

•

What is JavaScript

•

Comments

•

JavaScript in a Browser

•

Data Types

•

Variables

•

Functions

•

Statements

•

Scope

WOODIWISS.ME
What is JavaScript
•

Lightweight Scripting
Language.

•

Interpreted.

•

Object Orientated.

•

Prototype-based.

WOODIWISS.ME
Easy to pick up.
difficult to master.

WOODIWISS.ME

Freelance Web Developer & Lecturer
in the Winchester, Hampshire area.
ECMA
What/Who is ECMA?

WOODIWISS.ME
ECMA
What/Who is ECMA?
•

European Computer Manufacturers Association.

WOODIWISS.ME
ECMA
What/Who is ECMA?
•

European Computer Manufacturers Association.

•

Non-profit Standards Organisation.

WOODIWISS.ME
ECMA
What/Who is ECMA?
•

European Computer Manufacturers Association.

•

Non-profit Standards Organisation.

•

Introducing ECMAScript!

WOODIWISS.ME
ECMAScript
Language

ECMAScript.es

Dialects
JavaScript.js
WOODIWISS.ME

ActionScript.as
So what can
javascript do?

WOODIWISS.ME

Freelance Web Developer & Lecturer
in the Winchester, Hampshire area.
Hardware Programming
•

Arduino via NodeJS
framework.

•

Tessel - micro-controller that
runs JavaScript.

•

Uniduino - gives you the
power to connect the Unity
game engine to Arduino.

•

Control peripherals e.g.
GamePads.

WOODIWISS.ME
Create Hybrid Apps
•

PhoneGap - iOS, Android,
Blackberry, Windows Phone
& more.

•

TideSDK - Windows, OSX,
Linux.

•

Icenieum - Windows, Web,
iOS.

•

Chrome Apps.

WOODIWISS.ME
Server Side

•

Nodejs

•

Among others…

WOODIWISS.ME
Client Side
•

Vanilla JavaScript in a browser.

•

jQuery - simplify client side
scripting.

•

Zepto - Lightweight jQuery
alternative.

•

Three.js - 3D graphics on the
web.

•

AngularJS - SPA framework.

•

jQuery Mobile - Touch
optimised.

WOODIWISS.ME
In the Browser
•

Lets look at some Developer tools.
•

Firefox - Firebug.

•

Chrome - Web Developer Tools.

•

Internet Explorer - Developer ToolBar.

•

Opera - Dragonfly.

WOODIWISS.ME
Variables
•

Used to store data.

•

Single line style.

•

Multiline.

•

Typically must begin with a
letter ( $ and _ are valid )

•

Case sensitive.

•

Over-writable - dynamic.

WOODIWISS.ME
Statements

•

The end of a command.

•

Tells the interpreter (browser)
that your intention is finished.

WOODIWISS.ME
Comments
•

Helpful notes.

•

Good for debugging.

•

Working with others.

•

Don’t overuse.

WOODIWISS.ME
Data Types
•

Primary

!

•

•

“Hello” - “” - “1984” - “TRUE”

•

Number

•

19 - 19.333

•
•

String

Boolean

•

true - false

•

var car = { myCar: “Saturn", getCar:
CarTypes("Honda"), special: Sales };

•

var coffees = ["French Roast", "Colombian", "Kona"];

•

Object

•
•

!

Composite

Array

Special

•

Special

•

Null

•

null, 0, false.

•

Undefined

•

undefined value.

WOODIWISS.ME
Functions
WOODIWISS.ME
Calling / Invoking
Line 12

WOODIWISS.ME
WOODIWISS.ME
WOODIWISS.ME
Define with arguments.

WOODIWISS.ME
Define with arguments.

WOODIWISS.ME
Define with arguments.

Call with arguments.

WOODIWISS.ME
Define with arguments.

Call with arguments.

WOODIWISS.ME
Define with arguments.

1

Call with arguments.

WOODIWISS.ME
Define with arguments.

1

Call with arguments.

WOODIWISS.ME
Define with arguments.

1

Call with arguments.

WOODIWISS.ME
Define with arguments.

1

1

Call with arguments.

WOODIWISS.ME
Define with arguments.

1

1

Call with arguments.

WOODIWISS.ME

1
Define with arguments.

1

1

Call with arguments.

WOODIWISS.ME

1
Define with arguments.

1

10

1

Call with arguments.

WOODIWISS.ME

1
Define with arguments.

1

10

1

Call with arguments.

WOODIWISS.ME

1
Define with arguments.

1

10

10

1

Call with arguments.

WOODIWISS.ME

1
Scope
WOODIWISS.ME
WOODIWISS.ME
WOODIWISS.ME
WOODIWISS.ME
WOODIWISS.ME
Links / Research
•

https://developer.mozilla.org/en-US/docs/Web/JavaScript

•

https://developer.mozilla.org/en/learn/javascript

•

http://www.creativebloq.com/web-design/things-you-didnt-know-javascript-could-do-6122835

•

http://tessel.io/

•

http://www.uniduino.com/

•

https://wiki.mozilla.org/GamepadAPI

•

http://www.tidesdk.org/

•

http://www.icenium.com/?
utm_source=html5weekly&utm_medium=banner&utm_campaign=html5weeklynewsletter&utm_content=link1

•

http://developer.chrome.com/apps/about_apps.html

•

http://nodejs.org/

•

http://en.wikipedia.org/wiki/List_of_JavaScript_libraries

•

http://mothereff.in/js-variables

•

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Values,_variables,_and_literals

WOODIWISS.ME
Questions?

WOODIWISS.ME

Freelance Web Developer & Lecturer
in the Winchester, Hampshire area.

technology3-javascript-basics