Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 49 additions & 8 deletions practice.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,35 @@
// Create a variable called myName that is a string data type

// Code here
var myName = "Noe";

//////////////////PROBLEM 2////////////////////

// Create a variable called myAge that is a number data type

// Code here
var myAge = 21;

//////////////////PROBLEM 3////////////////////

// Create a variable called lovesCode that is a boolean data type

// Code here
var lovesCode = true;

//////////////////PROBLEM 4////////////////////

// Create a variable called greatestFear that is undefined because we fear nothing

// Code here
var greatestFear;

//////////////////PROBLEM 5////////////////////

// Create a variable called boomCampGoal that is null because we are just starting out

// Code here
var boomCampGoal = null;

//////////////////PROBLEM 6////////////////////

Expand All @@ -36,20 +41,27 @@
// plus the value of the name parameter.

// Code here
function greeting(myName) {
return `Hello, ${myName}`;
}

//////////////////PROBLEM 7////////////////////

// Rewrite the function greeting as a function expression.
// Name it newGreeting.

// Code Here
var newGreeting = function(myName) {
return `Hello, ${myName}`;
};

//////////////////PROBLEM 8////////////////////

// Create an array called groceries with the values
// "apples", "milk", "eggs", "bread"

// Code Here
var groceries = ["apples", "milk", "eggs", "bread"];

//////////////////PROBLEM 9////////////////////

Expand All @@ -59,11 +71,13 @@
// and goodBoy (a boolean).

// Code Here
var dog = { name: "Husky", color: "gray", age: 5, goodBoy: true };

// ...access the dog's name from the object and assign it to a
// variable called boomCampClassPet.

// Code Here
var boomCampClassPet = dog.name;

//////////////////PROBLEM 10////////////////////

Expand All @@ -75,6 +89,15 @@
// with NAMEPARAM being the name parameter being passed in

// Code here
function nameCheck(myName) {
if (myName == "Steven") {
return "What is up Steven?";
} else if (myName == "Bryan") {
return "Hey Bryan!";
} else {
return "Cool name, " + myName;
}
}

//////////////////PROBLEM 11////////////////////

Expand All @@ -83,11 +106,15 @@
// The add function should return the two parameters added together

// Code Here
function add(num_one, num_two) {
return num_one + num_two;
}

// Now invoke add, passing in the numbers 3 and 4
// storing the result in the variable mathSum.

// Code Here
var mathSum = add(3, 4);

//////////////////PROBLEM 12////////////////////

Expand All @@ -99,20 +126,31 @@
// Otherwise, you should return the string 'you need to evaluate your favorite color choice'

// Code here
function faveColorFinder(color) {
if (color == "red") {
return "red is a great color";
} else if (color == "green") {
return "green is a solid favorite color";
} else if (color == "black") {
return "so trendy";
} else {
return "you need to evaluate your favorite color choice";
}
}

//////////////////PROBLEM 13////////////////////

let duck = 'cute';
let duck = "cute";

function bathroom() {
let rubberDuck = 'squeaky';
let rubberDuck = "squeaky";
function bathtub() {
let sailorDuck = 'nautical';
let sailorDuck = "nautical";
}
}

function pond() {
let realDuck = 'fluffy';
let realDuck = "fluffy";
}

// There are 4 variables above: duck, rubberDuck, sailorDuck and realDuck
Expand All @@ -122,28 +160,31 @@ function pond() {
// as strings.

// This array should contain the variable names (as strings) accessible in the global scope.
let globalScope = ['duck', 'sailorDuck', 'rubberDuck', 'realDuck'];
let globalScope = ["duck"];

// This array should contain the variable names (as strings) accessible in the bathroom function.
let bathroomScope = ['duck', 'sailorDuck', 'rubberDuck', 'realDuck'];
let bathroomScope = ["duck", "rubberDuck"];

// This array should contain the variable names (as strings) accessible in the bathtub function.
let bathtubScope = ['duck', 'sailorDuck', 'rubberDuck', 'realDuck'];
let bathtubScope = ["duck", "sailorDuck", "rubberDuck"];

// This array should contain the variable names (as strings) accessible in the pond function.
let pondScope = ['duck', 'sailorDuck', 'rubberDuck', 'realDuck'];
let pondScope = ["duck", "realDuck"];

//////////////////PROBLEM 14////////////////////

// Create a variable called age with your age assigned to you

// Code Here
var age = 21;

// FLASH FORWARD TO NEXT YEAR
// reassign the value of age to be one greater than it was, because, we all get older

// Code Here
var age = 22;

// Good news! We can live forever. Set your age to 999

// Code Here
var age = 999;
4 changes: 2 additions & 2 deletions user.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"name": "",
"email": ""
"name": "Noe Philip Gabriel M. Restum",
"email": "noe.restum@boom.camp"
}