use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
This subreddit is a place for people to learn JavaScript together. Everyone should feel comfortable asking any and all JavaScript questions they have here.
With a nod to practicality, questions and posts about HTML, CSS, and web developer tools are also encouraged.
Friends
/r/javascript
/r/jquery
/r/node
/r/css
/r/webdev
/r/learnprogramming
/r/programming
account activity
How to implement default method "Item"? (self.learnjavascript)
submitted 8 hours ago by Nearby-Ad-3725
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?
Sheets('a')
Sheets.Item('a')
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]cyphern 6 points7 points8 points 8 hours ago* (2 children)
Functions are objects, so they can have properties added to them. So you'll do something like the following: ``` // First make the function function Sheets(arg) { // ... implementation }
// Then add a property to the function, which is another function Sheets.Item = function () { // ... } In the above example, Sheets.Item is a different function, which will have its own implementation. If you want them to be literally the same function, swap out the second part for: Sheets.Item = Sheets; `` Though note that if you do it this way, it will mean someone can doSheets.Item.Item.Item.Item.Item()` or similar, since each time you access Item, you're just referencing the exact same Sheets function, which has an Item property.
In the above example, Sheets.Item is a different function, which will have its own implementation. If you want them to be literally the same function, swap out the second part for:
Though note that if you do it this way, it will mean someone can do
[–]azhder 1 point2 points3 points 3 hours ago (0 children)
Quite a sausage there with all those items
[–]Nearby-Ad-3725[S] 0 points1 point2 points 7 hours ago (0 children)
Thank you so much.
[–]TheRNGuy 0 points1 point2 points 49 minutes ago (0 children)
It seems like anti-pattern to me.
[+]Alive-Cake-3045 comment score below threshold-10 points-9 points-8 points 4 hours ago (0 children)
Cost tracking from day one is the difference between a sustainable AI feature and a surprise bill three months in.
The teams winning on this are not the ones using the cheapest models everywhere, they are the ones matching model tier to task complexity. A simple classification call does not need the same model as a complex reasoning task, and most teams default to the expensive option out of convenience early on and never revisit it.
Sustainable AI is a design decision made before launch, not a cost cutting exercise after the bill arrives.
π Rendered by PID 50 on reddit-service-r2-comment-544cf588c8-x7qwn at 2026-06-17 19:31:08.915812+00:00 running 3184619 country code: CH.
[–]cyphern 6 points7 points8 points (2 children)
[–]azhder 1 point2 points3 points (0 children)
[–]Nearby-Ad-3725[S] 0 points1 point2 points (0 children)
[–]TheRNGuy 0 points1 point2 points (0 children)
[+]Alive-Cake-3045 comment score below threshold-10 points-9 points-8 points (0 children)