var URIController = {
get href() {
return url.location.href;
}
}
I have above object structure. But URIController.href property depends on another object, url.
If the url is defined globally, URIController.href works. But I want to pass url object to href getter manually.
var URIController = {
get href(url) {
return url.location.href;
}
}
Changed the getter to accept url parameter but
URIController.href(url)
throws error because href is not a function.
Is it possible to pass arguments to getter in javascript?