I have two classes as follows.
class Users{
createUser(){
//...
}
}
Another class
class Cars{
createCar(){
//....
}
}
Main class
class Api{
//....
}
I need to access the first two classes though last class as follows
Api=new API()
Api.Users.createUser()
//also
Api.Cars.createCar()
How it is possible in javascript. is this a good practice?