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
32 changes: 32 additions & 0 deletions basics.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ Do the following:
*/



const str = '1999'
let numper = parseInt(str)
console.log(numper)


/*
Task: Mood Checker

Expand All @@ -21,6 +27,14 @@ Do the following:
*/


let user = prompt("how is your situation")

if(user === "hppy"){
alert("Yay me too!'")
} else {
alert("Aw cheer up!'")
}

/*
Task: Odd or Even / kisi ama dhaban

Expand Down Expand Up @@ -94,6 +108,24 @@ It's okay for it to be slow.
*/




function fizzBuzz() {
for (let i = 1; i <= 100; i++) {
if (i % 3 === 0 && i % 5 === 0) {
console.log("FizzBuzz");
} else if (i % 3 === 0) {
console.log("Fizz");
} else if (i % 5 === 0) {
console.log("Buzz");
} else {
console.log(i);
}
}
}

// Call the fizzBuzz function to run the program
fizzBuzz();
/*💪💪💪💪💪💪💪💪💪💪 Stretch 💪💪💪💪💪💪💪💪💪💪*/

//Vowel Counter - How many vowels are there?
Expand Down
29 changes: 29 additions & 0 deletions functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,35 @@
// Take the commented ES5 syntax and convert it to ES6 arrow Syntax


const myfunction = ()=> {
console.log("Function was invoked!");


}

myfunction()





let anotherFunction = (numper,item)=> {

console.log(numper , item)


}
anotherFunction(3,6)




let add = (param1, param2) => {
return param1 + param2;
};

console.log(add(8,10))

/*

------------
Expand Down
49 changes: 48 additions & 1 deletion objects.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,51 @@ const example = {
//console.log(antonietta.multiplyNums(3,4));

// === Great work! === Head over to the the arrays.js. You may come back and attempt the Stretch Challenge once you have completed the challenges in arrays.js and function-conversion.js.



const intern1 = {
id: 1,
email: "mmelloy0@psu.edu",
firstName: "Mitzi",
gender: "F"
};

const intern2 = {
id: 2,
email: "kdiben1@tinypic.com",
firstName: "Kennan",
gender: "M"
};

const intern3 = {
id: 3,
email: "kmummery2@wikimedia.org",
firstName: "Keven",
gender: "M"
};

const intern4 = {
id: 4,
email: "gmartinson3@illinois.edu",
firstName: "Gannie",
gender: "M"
};

const intern5 = {
id: 5,
email: "adaine5@samsung.com",
firstName: "Antonietta",
gender: "F"
};


intern2.speak = function() {
return "Hello, my name is " + this.firstName + "!";
};

intern5.multiplyNums = function(num1, num2) {
return num1 * num2;
};

console.log(intern2.speak()); // "Hello, my name is Kennan!"
console.log(intern5.multiplyNums(3, 4)); // 12