I've read numerous examples converting from String to Boolean.
For example,
myString = (myString == "true");
But I'm unable to apply the logic to my code. Can someone help?
CommonConfig.getFeatureFlags['analytics.demo'] returns "true" (Note the "").(That's how backend returns it)
var FeatureFlag = _.extend(CommonConfig, {
demoFeature: String == CommonConfig.getFeatureFlags['analytics.demo'], //either "true" or "false" but I want to make it to true or false
});
Question: I want to convert from String "true" to boolean. And pass true or false based upon!
Can someone help?