Skip to content

Instantly share code, notes, and snippets.

@jnf
Last active August 18, 2017 19:29
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save jnf/56201e83a478497f7a975f95035b6a79 to your computer and use it in GitHub Desktop.
Save jnf/56201e83a478497f7a975f95035b6a79 to your computer and use it in GitHub Desktop.
var answers = [
"Yes",
"No",
"It was the tofu",
"Call your mom",
"IDK"
];
function shakeEightBall () {
var rando = Math.floor(Math.random() * 5);
var fortune = answers[rando];
if (fortune) {
console.log(fortune);
} else {
console.log("Ask again");
}
}
var cart1 = [
{ name: "fanciest jacket", price: 17.99 },
{ name: "not so fancy coat", price: 5.99 },
{ name: "golden tap shoes", price: 59.85 },
{ name: "doggles (google it)", price: 17.44 },
{ nane: "+2 argyle socks of cunning", price: 31.99 }
];
var cart2 = [
{ name: "lonely glove", price: 0.01 }
];
function total (list) {
}
console.log('I am loops!');
var album = {
artist: "Prince",
title: "Purple Rain",
"best song": "When Doves Cry",
label: "Warner Bros."
};
for (var key in album) {
var value = album[key];
console.log("The album's " + key + " is " + value);
}
// var birthday = {
// day: 26,
// month: 2,
// year: 1980
// }
//
// for (var key in birthday) {
// var value = birthday[key];
// console.log(key + ": " + value);
// }
//
// var lyrics = [
// "just a city boy",
// "born and raised in south detroit",
// "took the midnight train",
// "going annnyyyywheeeerrreeeeee"
// ];
//
// for (var i = 0; i < lyrics.length; i++) {
// console.log(lyrics[i]);
// }
// var birthday = [26, 2, 1980];
// var months = [
// "Jan.", "Feb.", "March", "Apr.", "May",
// "June", "July", "Aug.", "Sept.", "Oct.", "Nov.", "Dec."
// ];
//
// var output = "";
// for (var i = 0; i < birthday.length; i++) {
// output = output + birthday[i] + ' ';
// }
// console.log(output);
// "26 February 1980"
// for (var num = 100; num >= 20; num = num - 20) {
// console.log(num);
// }
var int = 99;
function addItUp(paramNum) {
paramNum = paramNum + 12;
console.log("Output is " + paramNum);
}
addItUp(int);
console.log(int);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment