Javascript run through - some examples…

//string

var name = “Scott”;

//number

var number = 4;

//if else

if (number === 4) {

console.log(name);

} esle {

console.log(“Not 4”);

}

things to remember

  • JS uses camelCaseWords

  • functions = abstract, break down into smaller pieces

var addition = function ( x,y ) {

return x + y;

}

var sum = addition (5,8);

console.log(sum);

var names = [‘cat’,’dog’]; (this is an array, which is compartmentalized info)

-historical info on bits, how computers work (0, 1 / off, on) so don’t get annoyed if codes don’t work, it’s dodo brain in some ways

Next week - complete through unit 4 on code academy (if this is too easy, speak up) and be prepared to talk about personal tracking