Javascript by itself can compromise your security because it can be used to pwn browser vulnerabilities, and in fact it frequently is used to do so. Malicious javascript can pwn browsers.