JavaScript


Fundamentals

http://seattlejs.training.formidablelabs.com

@FormidableLabs | formidablelabs.com

Tip - space bar advances slides

JavaScript!

  • The language of the browser
  • The language of everywhere
  • Easy to learn, hard to master

This workshop

We are going to cover a few basic concepts, tools, and tricks to get you started.

JavaScript

The building blocks: Arrays, Objects.

Arrays

Arrays are a simple, ordered list structure. Think pages in a book

Arrays Demo


                var list = ["zero", "one", "two", "three"];
                for (var i = 0; i < list.length; i++) {
                  console.log(i + ": " + list[i]);
                }
                

Objects

Objects group key-value pairs of variables and functions. Think "bag of properties"

Object Literals Demo


                var person = {
                  first: "Albert",
                  last: "Einstein",
                  job: "Physicist"
                };
                
                console.log("Hi " + person.first + " " + person.last);
                console.log("You are a " + person.job);
                

Object Classes Demo


                var Person = function (first, last, job) {
                  this.first = first;
                  this.last = last;
                  this.job = job;
                };
                
                var person = new Person("Albert", "Einstein", "Physicist");
                
                console.log("Hi " + person.first + " " + person.last);
                console.log("You are a " + person.job);
                

Object Concepts

... and all the other stuff ...

Further Reading

Thanks

@FormidableLabs | formidablelabs.com