One way to get "static" variables in a function (like the "static" keyword in C) in Javascript is to assign custom properties to the function object itself.
A few years ago, this caused problems with optimization in eg. V8 because when the function object's properties changed, the function had to be re-JIT-ted, etc.
Is this still the case, or is there a reliable way to benchmark this?