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

JavaScript

Please 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>
rydavim
rydavim
18,814 Points

It will be helpful if you could link to the course or video you're referring to.

1 Answer

Reggie Williams
STAFF
Reggie Williams
Treehouse Teacher

Hey msdsmd sm,dfsadf did you still have any questions about this? It looks like the comment in your code are correct