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 Object-Oriented JavaScript (2015) Introduction to Methods Returning Values

Vladimir Slepkov
Vladimir Slepkov
8,408 Points

How ui.js "knows" about dice object defined in the dice.js script?

When we refer to the dice object ( var result = dice.roll(); ) in the ui.js script, how is it possible for the script to take it from another script, namely dice.js, without any path specified?

1 Answer

Hi Vladimir,

This question has already been asked and answered here.

Vladimir Slepkov
Vladimir Slepkov
8,408 Points

Hi Mikis,

Now it makes sense to me. Thank you very much!)