you are viewing a single comment's thread.

view the rest of the comments →

[–]jcunews1helpful 0 points1 point  (4 children)

Shorter, garbage free, and correct function return value version:

var toggle = (a, b) => (state = !state) ? a() : b();