I just use the !!
operator with basic logic. Something like var isActive = formValue !== 'false' && !!formValue;
handles most situations. Deals with empty strings and undefined without issues. I’ve used this approach for years and never run into the weird edge cases you get with JSON parsing.