Skip to content

Instantly share code, notes, and snippets.

@rbarner14
Created August 15, 2017 04:12
Show Gist options
  • Save rbarner14/2997f51d9c6f164211b01f58d59e5264 to your computer and use it in GitHub Desktop.
Save rbarner14/2997f51d9c6f164211b01f58d59e5264 to your computer and use it in GitHub Desktop.
Ryan Barner's 1st Self-Assessment
console.log('Remember the Titans');
function billTotal(subtotal) {
var tip = subtotal * 0.15;
var tax = subtotal * 0.095;
return subtotal + tip + tax;
}
billTotal(10);
function range(start, end) {
var array = [];
for (var i = start; i < end; i++) {
array.push(i);
}
return array;
}
range(10, 2);
var person = {
name : {
first : "Alyssa",
middle: "P.",
last: "Hacker"
},
age : 26
}
function getFullName (object) {
for(var propName in object) {
if(object.hasOwnProperty(propName)) {
propValue = object[propName];
for(var key in propValue) {
var value = propValue[key];
}
for(var key3 in propValue) {
var value3 = propValue[key3];
}
for(var key2 in propValue) {
var value2 = propValue[key2];
return value2 + " " + value;
}
}
}
}
getFullName(person);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment