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 trialMichael Zito
Courses Plus Student 4,073 PointsNot getting it.
Again having issues. Not getting functions. =(
function returnValue(Michael) {
var echo;
return Michael;
}
returnValue = echo, Michael();
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JavaScript Basics</title>
</head>
<body>
<script src="script.js"></script>
</body>
</html>
2 Answers
Daniel Boisselle
Front End Web Development Techdegree Student 17,438 Pointsfunction returnValue (thisIsAnArgument) {
return thisIsAnArgument
}
var echo = returnValue('Something')
the text after 'function' is the name of that function
this function return whatever argument we pass to it
we have to define echo outside of this function
we assign echo to the returned value of whatever we call the 'returnedValue' function
Hope this helped!
Daniel Boisselle
Front End Web Development Techdegree Student 17,438 PointsKeep coding! Don't worry about learning everything today, it's a long process to conceptually wrap your head around all the rules and quirks. I suggest reading MDN documentation
Read the documents slowly and try to understand everything that's happening Mozilla Developer Network
I also suggest using sites like this below to really expose yourself to problems you wouldn't have though of that you have to figure out to complete. You can also look at other programmers solutions for different approaches. Codefights
let me know if I can ever help with anything! Dan
Michael Zito
Courses Plus Student 4,073 Pointsthank you so much.. I'll check it out. Even if it doesn't help (I'm sure it will), it makes things better that everyone has such good support from each other
Michael Zito
Courses Plus Student 4,073 PointsMichael Zito
Courses Plus Student 4,073 Pointsthis does help. Is it normal to have so many questions about javascript? I feel i'm not retaining all the info I'm getting.