Layth
Hi
Sorry but this is not only about JS this is about your complete website include Joomla, you can follow the suggestion from Google. It is checking, implement different things and testing to optimize a Joomla website and include several steps from server speed to page size, image and more.