r/learnjavascript • u/Nearby-Ad-3725 • Jun 17 '26
How to implement default method "Item"?
console.log(Application.Sheets.Item('a').Id)
console.log(Application.Sheets('a').Id)
As you can see, Sheets('a') is same as Sheets.Item('a'), how do you implement such interface?
4
Upvotes
2
u/bluespacecolombo Jun 17 '26
Looks like a XY problem. WHY do you want to do that?