The intended reach of Javascript is limited so it can not access the desktop nor any files in your computer. The security of your computer is limited to how up-to-date the browser is (patching etc), and the associated Plugins.
On the other side, "bad guys" try to find holes in technology and use that knowledge to gain access to something they otherwise wouldn't. When this happens, and the vendor is aware of it, a patch is released.
A few bad things Javascript can do:
Javascript alone might allow all the information of a poorly written website to be sent to a "bad guy". This is called XSS / CRSF.
It can also cause your logged in account to make changes to websites (editing financial data of a different unrelated site) without you knowing.
Finally in regards to your local computer, the exposure depends what add-ins are installed (Flash, etc). If the client has an old version of flash installed, then your whole PC can have malicious software installed on it, or have security dialogs altered to confuse even an educated/informed user.