Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Complete Deliverable #25

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
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
22 changes: 18 additions & 4 deletions app.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,32 @@
// 1.1. What is the difference between a parameter and an argument?

// A parameter is kind of like a place holder for some value the function will accept as input.
// An argument is something that has to be evaluated usually true/false.
// 1.2. Within a function, what is the difference between return and console.log?

// a return ends a function and send the output somewhere. it does not actively display output. A console.log outputs the what is referenced to the console
// 1. 3. What are the implications of the ability of a function to return a value?

// return allows the function's output value to be called simply by invoking the function.
// 2. calculateCube
function calculateCube(num) {
// YOUR CODE HERE
let cube = Math.pow(num, 2);
return cube;
}
console.log(calculateCube(5));

// 3. isAVowel
// YOUR CODE HERE
let vowelsArr = ["a", "e", "i", "o", "u"]
function isAVowel(letter) {
// YOUR CODE HERE

for(let i = 0; i < vowelsArr.length; i++){
if (letter == vowelsArr[i]) {
return true;
}

}
return false;
}
console.log(isAVowel("z"));

// 4. getTwoLengths
function getTwoLengths(word1, word2) {
Expand Down