- Notifications
You must be signed in to change notification settings - Fork414
Codespace opulent funicular 9576jgqxgx4hp4r6#208
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Open
ademontel wants to merge2 commits into4GeeksAcademy:mainChoose a base branch fromademontel:codespace-opulent-funicular-9576jgqxgx4hp4r6
base:main
Could not load branches
Branch not found:{{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline, and old review comments may become outdated.
Uh oh!
There was an error while loading.Please reload this page.
Open
Changes fromall commits
Commits
Show all changes
2 commits Select commitHold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
9 changes: 8 additions & 1 deletionexercises/001-isOldEnoughToDrink/app.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,11 @@ | ||
function isOldEnoughToDrink(age) { | ||
// your code here | ||
if (age >= 21) { | ||
return true; | ||
} | ||
else { | ||
return false; | ||
} | ||
} | ||
let output = isOldEnoughToDrink(22); | ||
console.log(output); |
9 changes: 8 additions & 1 deletionexercises/002-isOldEnoughToDrive/app.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,11 @@ | ||
function isOldEnoughToDrive(age) { | ||
// your code here | ||
if (age >= 16) { | ||
return true; | ||
} | ||
else { | ||
return false; | ||
} | ||
} | ||
let output = isOldEnoughToDrive(22); | ||
console.log(output); |
9 changes: 8 additions & 1 deletionexercises/003-isOldEnoughToVote/app.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,11 @@ | ||
function isOldEnoughToVote(age) { | ||
// your code here | ||
if (age >= 18) { | ||
return true; | ||
} | ||
else { | ||
return false; | ||
} | ||
} | ||
let output = isOldEnoughToVote(22); | ||
console.log(output); |
4 changes: 3 additions & 1 deletionexercises/004-isOldEnoughToDrinkAndDrive/app.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
function isOldEnoughToDrinkAndDrive(age) { | ||
// your code here | ||
return false; | ||
} | ||
let output = isOldEnoughToDrinkAndDrive(22); | ||
console.log(output); |
9 changes: 8 additions & 1 deletionexercises/005-checkAge/app.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,11 @@ | ||
function checkAge(name, age) { | ||
// your code here | ||
if (age >= 21) { | ||
return ("Welcome, " + name + "!"); | ||
} | ||
else { | ||
return ("Go home, " + name + "!"); | ||
} | ||
} | ||
let output = checkAge('Adrian', 32); | ||
console.log(output); |
4 changes: 3 additions & 1 deletionexercises/006-getFullName/app.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
function getFullName(firstName, lastName) { | ||
// your code here | ||
return(firstName + " " + lastName); | ||
} | ||
let output = getFullName('Joe', 'Smith'); | ||
console.log(output); |
4 changes: 3 additions & 1 deletionexercises/007-getLengthOfWord/app.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
function getLengthOfWord(word) { | ||
// your code here | ||
return(word.length); | ||
} | ||
let output = getLengthOfWord('some'); | ||
console.log(output); |
4 changes: 3 additions & 1 deletionexercises/008-getLengthOfTwoWords/app.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
function getLengthOfTwoWords(word1, word2) { | ||
// your code here | ||
return(word1.length + word2.length); | ||
} | ||
let output = getLengthOfTwoWords('some', 'words'); | ||
console.log(output); |
2 changes: 1 addition & 1 deletionexercises/009-getLengthOfThreeWords/app.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
12 changes: 11 additions & 1 deletionexercises/010-isSameLength/app.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,11 @@ | ||
// Write your function here | ||
function isSameLength(word1, word2) { | ||
if(word1.length == word2.length) { | ||
return true; | ||
} | ||
else { | ||
return false; | ||
} | ||
} | ||
let output = isSameLength('words', 'super'); | ||
console.log(output); |
9 changes: 8 additions & 1 deletionexercises/011-isGreaterThanTen/app.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,11 @@ | ||
function isGreaterThanTen(num) { | ||
// your code here | ||
if (num > 10){ | ||
return true; | ||
} | ||
else { | ||
return false; | ||
} | ||
} | ||
let output = isGreaterThanTen(11); | ||
console.log(output); |
9 changes: 8 additions & 1 deletionexercises/012-isLessThanThirty/app.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,11 @@ | ||
function isLessThan30(num) { | ||
// your code here | ||
if (num < 30){ | ||
return true; | ||
} | ||
else { | ||
return false; | ||
} | ||
} | ||
let output = isLessThan30(9); | ||
console.log(output); |
7 changes: 6 additions & 1 deletionexercises/013-equalsTen/app.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,9 @@ | ||
function equalsTen(num) { | ||
// your code here | ||
if (num == 10){ | ||
return true; | ||
} | ||
else return false; | ||
} | ||
let output = equalsTen(10); | ||
console.log(output); |
6 changes: 6 additions & 0 deletionsexercises/014-isLessThan/app.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,9 @@ | ||
function isLessThan(num1, num2) { | ||
// your code here | ||
if (num2 < num1){ | ||
return true; | ||
} | ||
else return false; | ||
} | ||
let output = isLessThan(9, 22); | ||
console.log(output); |
6 changes: 5 additions & 1 deletionexercises/015-isGreaterThan/app.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,8 @@ | ||
function isGreaterThan(num1, num2) { | ||
// your code here | ||
if (num2 > num1){ | ||
return true; | ||
} | ||
else return false; | ||
} | ||
8 changes: 7 additions & 1 deletionexercises/016-isEqualTo/app.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,7 @@ | ||
// Write your function here | ||
function isEqualTo(num1, num2){ | ||
if (num2 === num1){ | ||
return true; | ||
} | ||
else return false; | ||
} |
11 changes: 10 additions & 1 deletionexercises/017-isEven/app.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,10 @@ | ||
// Write your function here | ||
function isEven(num){ | ||
if ((num % 2)==0){ | ||
return true; | ||
} | ||
else return false; | ||
} | ||
let output = isEven(20); | ||
console.log(output); |
11 changes: 10 additions & 1 deletionexercises/018-isOdd/app.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,10 @@ | ||
// Write your function here | ||
function isOdd(num){ | ||
if ((num % 2) != 0){ | ||
return true; | ||
} | ||
else return false; | ||
} | ||
let output = isOdd(8); | ||
console.log(output); |
9 changes: 9 additions & 0 deletionsexercises/019-areBothOdd/app.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,10 @@ | ||
// Write your function here | ||
function areBothOdd(num1,num2){ | ||
if (((num1 % 2) != 0)&&((num2 % 2) != 0)){ | ||
return true; | ||
} | ||
else return false; | ||
} | ||
let output = areBothOdd(1,4); | ||
console.log(output); |
11 changes: 10 additions & 1 deletionexercises/020-isEitherEven/app.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,10 @@ | ||
// Write your function here | ||
function isEitherEven(num1,num2){ | ||
if (((num1 % 2) === 0)||((num2 % 2) === 0)){ | ||
return true; | ||
} | ||
else return false; | ||
} | ||
let output = isEitherEven(1,4); | ||
console.log(output); |
9 changes: 9 additions & 0 deletionsexercises/021-isOddLength/app.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,10 @@ | ||
// Write your function here | ||
function isOddLength(word){ | ||
if ((word.length % 2) != 0){ | ||
return true; | ||
} | ||
else return false; | ||
} | ||
let output = isOddLength('special'); | ||
console.log(output); |
11 changes: 10 additions & 1 deletionexercises/022-isEvenLength/app.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,10 @@ | ||
// Write your function here | ||
function isEvenLength(word){ | ||
if ((word.length % 2) === 0){ | ||
return true; | ||
} | ||
else return false; | ||
} | ||
let output = isEvenLength('wow'); | ||
console.log(output); |
9 changes: 8 additions & 1 deletionexercises/023-computeAverageLengthOfWords/app.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,8 @@ | ||
// Write your function here | ||
const average = array => array.reduce((a, b) => a + b) / array.length; | ||
function computeAverageLengthOfWords(word1,word2) { | ||
let anArray = [word1.length, word2.length] | ||
return average(anArray); | ||
} | ||
let output = computeAverageLengthOfWords('code', 'programs'); | ||
console.log(output); |
10 changes: 9 additions & 1 deletionexercises/024-isEvenAndGreaterThanTen/app.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,9 @@ | ||
// Write your function here | ||
function isEvenAndGreaterThanTen(num){ | ||
if (((num % 2) == 0)&&(num > 10)) { | ||
return true; | ||
} | ||
else return false; | ||
} | ||
let output = isEvenAndGreaterThanTen(13); | ||
console.log(output); |
8 changes: 7 additions & 1 deletionexercises/025-average/app.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,7 @@ | ||
// Write your function here | ||
function average(num1,num2) { | ||
return ((num1+num2)/2); | ||
} | ||
let output = average(4, 6); | ||
console.log(output); |
3 changes: 3 additions & 0 deletionsexercises/026-computeAreaOfATriangle/app.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,4 @@ | ||
// Write your function here | ||
function computeAreaOfATriangle(base,height) { | ||
return ((base*height)/2); | ||
} |
7 changes: 6 additions & 1 deletionexercises/027-cube/app.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,6 @@ | ||
// Write your function here | ||
function cube(side){ | ||
return (side*side*side); | ||
} | ||
let output = cube(3); | ||
console.log(output); |
3 changes: 3 additions & 0 deletionsexercises/028-square/app.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,4 @@ | ||
// Write your function here | ||
function square(number){ | ||
return (number*number); | ||
} |
10 changes: 8 additions & 2 deletionsexercises/029-getProperty/app.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,10 @@ | ||
// your code here | ||
let car = { | ||
model: 'Toyota' | ||
}; | ||
function getProperty(obj, key) { | ||
return obj[key]; | ||
} | ||
let output = getProperty(car, 'model'); | ||
console.log(output); // --> 'Toyota' |
8 changes: 7 additions & 1 deletionexercises/030-addProperty/app.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,10 @@ | ||
function addProperty(obj, key) { | ||
// your code here | ||
obj[key] = true; | ||
return obj; | ||
} | ||
let myObj = {}; | ||
addProperty(myObj, 'myProperty'); | ||
console.log(myObj.myProperty); // --> true |
11 changes: 10 additions & 1 deletionexercises/031-removeProperty/app.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,13 @@ | ||
function removeProperty(obj, key) { | ||
// your code here | ||
delete obj[key]; | ||
return obj; | ||
} | ||
let obj = { | ||
name: 'Sam', | ||
age: 20 | ||
} | ||
removeProperty(obj, 'name'); | ||
console.log(obj.name); // --> undefined |
15 changes: 13 additions & 2 deletionsexercises/032-addFullNameProperty/app.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,15 @@ | ||
function addFullNameProperty(obj) { | ||
// Add your code after this line | ||
let firstName = obj.firstName; | ||
let lastName = obj.lastName; | ||
let fullName = firstName + " " + lastName; | ||
obj.fullName = fullName; | ||
return obj; | ||
} | ||
let person = { | ||
firstName: 'Jade', | ||
lastName: 'Smith' | ||
}; | ||
addFullNameProperty(person); | ||
console.log(person.fullName); // --> 'Jade Smith' |
Oops, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.