javascript files in AVAST resources

Yesterday, I was hit by a nasty PUP/Malware from DriverUpdate.su and had difficulty to remove their files, particularly this one:

C:\Program Files\AVAST Software\Avast\resources\PerformanceDriverUpdater.js.

Then, I noticed that there is a collection of .js files stored in the above indicated subfolder. Javascript files can be very dangerous. What are they doing in AVAST and what is their purpose?

Simple - they are part of Avast code.
I.e. there are parts of Avast (mainly UI-related) that are implemented in javascript.