How to call a function in another js file?

How to call a function in another js file?

Hi, 
It a basic stuff. I have a function test() in a.js and want to call it inside another function in the file b.js, how do I do it? I am not managing to make it working. Message in Eclipse when trying to open the Declaration is that "Current text selection does not resolve to a JavaScript element".