3 ms·
Or: foo[someCondition? 'show' : 'hide'](); Although looking up functions using raw strings is less than elegant. I'd be tempted to abstract the pattern us
by chriswarbo 12y ago
Or:
foo[someCondition? 'show' : 'hide']();
Although looking up functions using raw strings is less than elegant. I'd be tempted to abstract the pattern using a function, but at that point I'd be doing functional programming anyway and wouldn't be using methods ;)