JavaScript has never been known to be safe in a browser. To achieve nefarious purposes, malicious code developers are continually looking for new ways to abuse how each engine operates as well as its available JavaScript features. JavaScript was quite risky in the browser for the first few years.