Hi Smit!
Welcome to TYPO3!
If I understand you correctly, you are saying that the JavaScript is located within an extension’s Resources/Private/ folder. JavaScript should be located within Resources/Public/, for example Resources/Public/JavaScript/.
You may also find additional help in this recent post:
I hope this helps. Please let me know how it goes and don’t hesitate to ask questions.
Best wishes
Mathias