Created
July 2, 2018 23:21
-
-
Save SalesforceBobLightning/fb1f80d5d2210b1a3dd2e1e8b7bd3ef8 to your computer and use it in GitHub Desktop.
JavaScript method which converts Boolean properties of an Object to String
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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