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

Jeanelle pazos #135

Open
wants to merge 3 commits into
base: master
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
43 changes: 36 additions & 7 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,11 @@ function addNumbers(num1, num2) {
*
*/
function sayGoodbye(/* code here */) {
const name = 'Jeanelle'
/* code here */
return 'Goodbye, ${name}. Have a great day.';
}

console.log(sayGoodbye("Jeanelle"));
/**
* ### Challenge `temperatureCtoF`
*
Expand All @@ -54,9 +56,12 @@ function sayGoodbye(/* code here */) {
* Hint 1: The formula for converting celsius to fahrenheit is t*9/5 + 32 where t is the temperature in celsius.
* Hint 2: There is a very easy way to round numbers in JS. Do a google search to find out how.
*/
function temperatureCtoF(/* code here */) {
function temperatureCtoF(temperature /* code here */) {
return Math.round(temperature * (9 / 5) + 32);

/* code here */
}
console.log(temperatureCtoF(24));

/**
* ### Challenge `temperatureInF`
Expand All @@ -75,9 +80,17 @@ function temperatureCtoF(/* code here */) {
*
* Hint: You can call your `temperatureCtoF` function from inside `temperatureInF`.
*/
function temperatureInF(/* code here */) {
function temperatureInF(temperature, unit/* code here */) {
/* code here */
if (unit === "F"){
return (temperature + unit);
}
else if (unit === "C"){
return (temperature + "F");
}
}
console.log(temperatureCtoF(88));
console.log(temperatureCtoF(24));


/**
Expand All @@ -96,9 +109,16 @@ function temperatureInF(/* code here */) {
* email: "[email protected]",
* }
*/
function makePersonObject(/* code here */) {
function makePersonObject(id, name, email) {
/* code here */
const thisPerson ={
id:id,
name:name,
email:email,
};
return thisPerson;
}
console.log(makePersonObject(5,"Leia", "[email protected]"));

/**
* ### Challenge `getName`
Expand All @@ -113,10 +133,16 @@ function makePersonObject(/* code here */) {
* passing { id: 1, name: 'Leia', email: '[email protected]` } as the argument,
* the returned value should look like `Hello, my name is Leia`.
*/
function getName(/* code here */) {
function getName({newPerson}) {
/* code here */
return ('Hello, my name is ${this.name}');
}

const thisPerson ={
id:5,
name:"Leia",
email: "[email protected]",
};
console.log(getName(thisPerson));

/**
* ### Challenge `appleIndex`
Expand All @@ -133,9 +159,12 @@ function getName(/* code here */) {
* passing in [ 'orange', 'grape', 'apple', 'banana', 'mango' ] as the argument,
* the returned value should be: 2.
*/
function appleIndex(/* code here */) {
function appleIndex(array/* code here */) {
/* code here */
const fruits = [ 'orange', 'grape', 'apple', 'banana', 'mango'];
return fruits.indexOf(array)
}
console.log(appleIndex('apple'));

/**
* ### Challenge `isItAnApple`
Expand Down