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
23 changes: 18 additions & 5 deletions exercises.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,9 @@ if(today === "Friday"){
If/else statements = Evaluates (or checks) a condition. If the condition is true, the first code block is executed. If the condition is false, the second code block is executed instead.
*/

/*if(today === "Friday"){
return "Let's Party!";
}else{
return "Get back to coding!";
};*/
console.log('test')




/*
Expand All @@ -30,6 +28,7 @@ If/else statements = Evaluates (or checks) a condition. If the condition is true
*/



/*
* #2
* Function - login
Expand All @@ -42,7 +41,15 @@ If/else statements = Evaluates (or checks) a condition. If the condition is true
* Console.log your result.
*/

function login(password){
if(password === 'test1234'){
return 'Login Success!!!!!';
}else{
return 'get outta hea with 7 bangs!!!!!!!!!!!!!!'
}
}

console.log(login('test12345'))
/*
* #3
* Function - isGreaterThan
Expand Down Expand Up @@ -84,6 +91,9 @@ If/else statements = Evaluates (or checks) a condition. If the condition is true
* Console.log your result.
*/

var word = 'cat' //global scope
console.log(word.length)



/*
Expand Down Expand Up @@ -219,6 +229,9 @@ If/else statements = Evaluates (or checks) a condition. If the condition is true






/*
For loops - A for loop checks a condition a specific number of times and allows us to execute a code block and evaluate a condition to determine if our loop should run again.

Expand Down
33 changes: 12 additions & 21 deletions solutions.js
Original file line number Diff line number Diff line change
Expand Up @@ -479,29 +479,20 @@ Final Boss
*/

var phrase = "An apple a day keeps Alice feeling awesome!";

function removeLetter(str){
var newArr = [];
for(var i = 0; i<str.length; i++){
console.log(str[i]);
if(str[i] !== 'a' && str[i] !== "A"){
newArr.push(str[i]);
}
var newArr = [];

function removeLetter(str){
var strToArr = str.split('')
for(var i = 0; i<strToArr.length; i++){
if(strToArr[i] !== 'A' && strToArr[i] !== 'a'){
newArr.push(strToArr[i])
}
console.log(newArr);
return newArr;
}
removeLetter(phrase);









}
return newArr;
}
removeLetter(phrase)

console.log(newArr)