Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save SalesforceBobLightning/fb1f80d5d2210b1a3dd2e1e8b7bd3ef8 to your computer and use it in GitHub Desktop.

Select an option

Save SalesforceBobLightning/fb1f80d5d2210b1a3dd2e1e8b7bd3ef8 to your computer and use it in GitHub Desktop.
JavaScript method which converts Boolean properties of an Object to String
castBooleanPropertiesToString : function(object) {
var props = Object.getOwnPropertyNames(object);
for (var i = 0; i < props.length; i++) {
var propName = props[i];
if (typeof object[propName] == 'boolean'){
object[propName] = object[propName].toString();
}
}
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment