Java и JavaScript одинаково

Absolutely not. They are just like car and carpet.
Enthusiastic Elk