Is java script necessary for hacking?

No. There are many way of breaking into a system without using JavaScript.