is it setting your PVR?
connecting up the stereo?
writing Python?
writing HTML, CSS, JavaScript?
... what ISN'T coding???
(image from http://www.bioprepper.com/2014/07/06/survival-communications-the-utility-of-morse-code/ )
You'll create a simple word guessing game where the user gets infinite tries to guess the word (like Hangman without the hangman, or like Wheel of Fortune without the wheel and fortune).
syntax (rules) and structure (fundamentals)!
(AP Photo/Francois Mori)
console.log("heeeeeellllooooo!!!");
var x = 3;
console.log(x);
console.log("hello".toUpperCase());
console.log("3" + 4);
console.log(123 == "123");
console.log(123 === "123");
var pet = "kittens";
if (pet == "puppies") {
pet += "!";
} else if (pet == "kittens") {
pet += "!!";
} else {
pet = "?" + pet;
}
console.log(pet);
var obj = {
name: "Carrot",
details: {
color: "orange",
servingsize: 12
}
}
obj.details.servingsize;
var obj = {
name: "Carrot",
details: {
color: "orange",
servingsize: 12
}
}
obj.details.servingsize;
obj.details.servingsize = 42;
obj.details.servingsize;
var a = new Array();
a[0] = "dog";
a[1] = "cat";
a[2] = "hen";
for (var i = 0; i < a.length; i++) {
console.log(a[i]);
}
var a = new Array();
a[0] = "dog";
a[1] = "cat";
a[2] = "hen";
for (var i = 0; i < a.length; i++) {
console.log(a[i]);
}
a.push("cow");
for (var i = 0; i < a.length; i++) {
console.log(a[i]);
}
function add(x, y) {
var total = x + y;
return total;
}
add(2,3);
function add(x, y) {
var total = x + y;
return total;
}
add(2,3);
console.log(total);
function add(x, y) {
var total = x + y;
return total;
}
var i, tot;
for (i = 0; i < 10; i++) {
tot = add(2,i);
console.log(tot);
}