Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Brooke Guy
8,179 PointsIs there anyone who can help me with the JavaScript challenges?
Is there anyone who can help me with the JavaScript challenges? I am getting the first and/or second steps right but not able to get the whole challenges correct...
Is there anyone who can help me with these?
5 Answers
Juthawong Naisanguansee
Full Stack JavaScript Techdegree Graduate 80,724 PointsYes Brooke ,
I Already Answer Your Question on The Old Post ;)
https://teamtreehouse.com/community/what-is-the-last-step
Cheers!
Edit
I'm Really Sorry For Misunderstanding. Your Code is Almost Right. The Instruction may sound a bit confusing. Just Create New Variable Name Echo That Call The Return Value Function
var echo = returnValue("My name is Brooke");
The Full Code Looks Like This
function returnValue(brooke){
return brooke;
}
var echo = returnValue("My name is Brooke");
Thanks
Brooke Guy
8,179 PointsThis is a different one I am getting wrong lol.
Brooke Guy
8,179 PointsChallenge Task 2 of 2 After your newly created returnValue function, create a new variable named echo. Set the value of echo to be the results from calling the returnValue function. When you call the returnValue function, make sure to pass in any string you'd like for the parameter.
function returnValue (x) {
return x;
}
var echo();
I am not getting this one right either :(
Juthawong Naisanguansee
Full Stack JavaScript Techdegree Graduate 80,724 Pointsfunction returnValue(brooke){
return brooke;
}
var echo = returnValue("My name is Brooke");
Juthawong Naisanguansee
Full Stack JavaScript Techdegree Graduate 80,724 PointsI'm Really Sorry For Misunderstanding. Your Code is Almost Right. The Instruction may sound a bit confusing. Just Create New Variable Name Echo That Call The Return Value Function
var echo = returnValue("My name is Brooke");
Brooke Guy
8,179 PointsChallenge Task 1 of 2 Create a new function named max which accepts two numbers as arguments (you can name the arguments, whatever you would like). The function should return the larger of the two numbers.
HINT: You'll need to use a conditional statement to test the 2 parameters to see which is the larger of the two.
This is my code:
function max(x, y) { if(X > y); { return x; } else { return y; } }
Juthawong Naisanguansee
Full Stack JavaScript Techdegree Graduate 80,724 Pointsfunction max(x , y ){
if(x > y ) {
return x;
}
return y;
}
Juthawong Naisanguansee
Full Stack JavaScript Techdegree Graduate 80,724 PointsFor Challenge 2 ,
In case you ask me :)
function max(x , y ){
if(x > y ) {
return x;
}
return y;
}
alert(max(5,6));
Brooke Guy
8,179 PointsThank you SO SO much!
Juthawong Naisanguansee
Full Stack JavaScript Techdegree Graduate 80,724 PointsYou're Welcome :)