Closed bcipolli closed 9 years ago
Javascript sucks at optional arguments. We can either:
brain.init()
I prefer the latter. In this PR, I change the Brain constructor to accept an object. Any property not defined on the object gets a default value. I find this to be clean, readable code. I also found this used elsewhere: https://stackoverflow.com/questions/3147640/javascript-optional-arguments-in-function
Brain
Also mixed in this PR (sorry!) is a bunch of cleanup items.
container_size
_this
this
ggg
two_hemis.html
@binarybottle please take a look at the Brain interface change. I think it's more like how ajax is called: pass an object with properties, rather than a list of arguments.
ajax
Javascript sucks at optional arguments. We can either:
brain.init()
I prefer the latter. In this PR, I change the
Brain
constructor to accept an object. Any property not defined on the object gets a default value. I find this to be clean, readable code. I also found this used elsewhere: https://stackoverflow.com/questions/3147640/javascript-optional-arguments-in-functionAlso mixed in this PR (sorry!) is a bunch of cleanup items.
container_size
function_this
variable name to access "hidden"this
object (current variable name:ggg
)two_hemis.html
demo