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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ functions and describe their differences

## Introduction

Today you'll worth through 7 JavaScript Tasks to practice today's objectives and get familiar and comfortable with the foundations of JavaScript.
Today you'll work through 7 JavaScript Tasks to practice today's objectives and get familiar and comfortable with the foundations of JavaScript.

Exercises are outlined in the `index.js` file, please read the instructions carefully for each task and complete it. Note that you may have to use your googling skills to research and look things up if you do not have all the information you need to complete the task.

Expand Down
67 changes: 45 additions & 22 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,17 @@ returns a value, that value will be logged to the console. An example of this w
/*
Task 1a - Voting Age

Do the following:
1. Create a variable called votingAge and assign it a value
2. Console log true if age is 18 or higher

HINT: no function required
*/

// Do the following:
// 1. Create a variable called votingAge and assign it a value
// 2. Console log true if age is 18 or higher

// HINT: no function required
// */
var votingAge = 18
if (votingAge > 18) {
votingAge = "true"
}
console.log(true)


/*
Expand All @@ -30,9 +34,14 @@ Do the following:

HINT: no function required
*/
var a = 2;
var b = 4;



switch (a, b) {
return(switch)

}
console.log(switch)


/*
Expand All @@ -45,8 +54,11 @@ Do the following:

HINT: look up the Number method
*/


var str = "1999"
parseInt("1999"); {
return(parseInt)
}
console.log(1999)


/*
Expand All @@ -57,12 +69,13 @@ Do the following:
2. Receive the parameters: a and b
3. Multiply a and b and return the answer
*/
var a = 2;
var b = 4;

function multiply(/*add your code here*/){
/*add your code here*/
function multiply(a, b) {
return(a * b);
}


console.log(multiply)

/*🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀 Task 2 🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀*/

Expand All @@ -74,11 +87,11 @@ Do the following:
3. Return the newly calculated age
*/

function dogYears(/*add your code here*/){
/*add your code here*/
}

function dogYears(14){
return(x + 7)

}
console.log(dogYears)

/*🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀 Task 3 🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀*/

Expand Down Expand Up @@ -107,7 +120,7 @@ Use the hungryDog function and feeding requirements below to do the following:
NOTE: If done correctly, a weight of 15 lbs and age of 1 year would return 0.44999999999999996
*/

function hungryDog(/*add your code here*/){
function hungryDog(52 lbs){
/*add your code here*/
}

Expand Down Expand Up @@ -135,9 +148,19 @@ Use the game function below to do the following:
*/

function game(user, computer){
/*add your code here*/
Math.floor(Math.random() * 2);
if (num = 2) {
result = "you win!";
} else if {
(num = 1) {
result = "you lose!";
} else {
(num = 0) {
result = "it's a tie";
}
return(game)
}

console.log(game)


/*🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀 Task 5 🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀*/
Expand Down