Skip to content
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
54 changes: 51 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ Do the following:
2. Return true if age is 18 or higher

*/
let votingAge =18;
console.log(votingAge>=18);



Expand All @@ -20,6 +22,11 @@ Do the following:
3. Return the new value of the 1st variable

*/
let x=2;
let y=3;
if(x==2){
x=y;
console.log(x)



Expand All @@ -33,7 +40,9 @@ Do the following:

HINT: look up the Number method
*/

var number='1999';
var number=1999;
console.log(number);

/*
Task 4 - Mood Checker
Expand All @@ -45,6 +54,21 @@ Do the following:

*/

let mood= 'happy'// or //'sad' ;
let mood1='happy';
let mood2='sad';
if (mood==mood1){
console.log("Yay me too!");

}
else if(mood==mood2){
console.log("Aw cheer up");

}
else{
console.log("So moody!");

}

/*

Expand All @@ -54,10 +78,17 @@ Task 5 - Odd or Even
Use conditionals to check if a hardcoded number is odd or even, and then console.log the number is odd or even with the numbers value.

*/
let nUmber=11 //or change whatever you want
if(nUmber%2==0){
console.log("the number is even")
}
else{
console.log("the number is odd")
}



var num; // write a number here

// write your conditions here


/*🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀 FIZZBUZZ 🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀*/
Expand Down Expand Up @@ -102,6 +133,23 @@ It's okay for it to be slow.

*/

let num=9;
for(let i=0;i<=100;i++){
if (num%3==0){
console.log("Fizz")
}
else if(num%5==0){
console.log("buzz")

}
else if(num%3==0 && (num%5==0){
console.log("FizzBuzz")

}


}


/*💪💪💪💪💪💪💪💪💪💪 Stretch 💪💪💪💪💪💪💪💪💪💪*/

Expand Down