View Single Post
05/29/14, 03:51 AM   #10
zamalek
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 9
This is quite common in Javascript (JQuery uses it a lot). Not a big fan of "gs" as it's a bit redundant - if you want to allow people to set properties to nil you can use varargs (which, again, is how you generally use this pattern in Javascript):

Code:
function SomeValue(...)
    if arg.n == 1 then _someValue = arg[1] end
    return _someValue
end
  Reply With Quote