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 trialThomas Scott
7,682 PointsWhy don't we need to define 'response' when we talk about promises and you can just instantly pass it a function?
I'm watching Fetch API videos with Guil and I'm just trying to remember why he can do something like fetch('url') .then(response => response.json())
Why are you able to just type 'response' without defining it and pass it directly into a function with => ? Does the compiler just automatically know that response is a function and doesn't need to be defined because of the syntax of the code?
Also I just want to make sure I'm 100% across this but the value given from fetch('url') and then the .then() by chaining .then() you are directly passing the value from fetch() into .then() does this happen with other functions or just promises?