In javascript, if i'm not using a class, i can do something like this:
const Module = (function(){
const myArray = [];
const myObject = {};
return { //this is my interfaces
myArray,
myObject,
myMethod1,
myMethod2,
myMethod3,
myMethod4,
myMethod99,
}
function myMethod1(){}
function myMethod2(){}
function myMethod3(){}
function myMethod4(){}
function myMethod99(){}
})
This provides me with some kind of structuring that let me list all the publicly available properties and methods on top so it's easier to navigate between module and see what are the available things in a module, and also it's easier to navigate to the function when using Intellisense from IDE such as Visual Studio Code, just go to the module, click the method you want to go to, then press F12, it will bring you to the function.
Now different case with class in javascript:
class Module{
constructor(){}
myMethod1(){}
myMethod2(){}
myMethod3(){}
myMethod4(){}
myMethod99(){}
}
in this case i can't separate the interface and implementation making it hard to navigate through the code. Is there any possibility that the Javascript can handle this kind of case?