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 trialmsdsmd sm,dfsadf
1,124 PointsPlease someone correct me if I am wrong. It is just two function.
<script>
function outer(){
console.log(44435)
function inner(){
alert('2345678')
}
return inner
}
let s =outer()/*This returns the inner function, and run all the code inside that function.*/
s() /*This called the inner function because the outer function return inner function*/
</script>
msdsmd sm,dfsadf
1,124 PointsHere is the link. https://teamtreehouse.com/library/fixing-our-problem-with-closures
1 Answer
Reggie Williams
Treehouse TeacherHey msdsmd sm,dfsadf did you still have any questions about this? It looks like the comment in your code are correct
rydavim
18,814 Pointsrydavim
18,814 PointsIt will be helpful if you could link to the course or video you're referring to.