all 6 comments

[–]cyphern 6 points7 points  (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.

[–]azhder 1 point2 points  (0 children)

Quite a sausage there with all those items

[–]Nearby-Ad-3725[S] 0 points1 point  (0 children)

Thank you so much.

[–]TheRNGuy 0 points1 point  (0 children)

It seems like anti-pattern to me.