The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript jQuery Plugin Conditional Logic Reply To: jQuery Plugin Conditional Logic


Nice Mottie, I like that change. You’ve removed two if statements which is great :D

I wonder how this sort of thing is handled in more complex situations with more configuration options. Perhaps switch statements are the logical next step?

I had considered that but it seems totally overkill for situations where there are only two options.

Also I found it slightly humorous that you linked to the ternery operators page when I’m already using a bunch of those elsewhere in the code. :) :)