{"action":"closed","issue":{"url":"https://api.github.com/repos/FieldServer/BootstrapFormHelpers/issues/1","repository_url":"https://api.github.com/repos/FieldServer/BootstrapFormHelpers","labels_url":"https://api.github.com/repos/FieldServer/BootstrapFormHelpers/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/FieldServer/BootstrapFormHelpers/issues/1/comments","events_url":"https://api.github.com/repos/FieldServer/BootstrapFormHelpers/issues/1/events","html_url":"https://github.com/FieldServer/BootstrapFormHelpers/issues/1","id":153784065,"number":1,"title":"Adding prototype function to the String incorrectly","user":{"login":"cyrussalem","id":3371956,"avatar_url":"https://avatars.githubusercontent.com/u/3371956?v=3","gravatar_id":"","url":"https://api.github.com/users/cyrussalem","html_url":"https://github.com/cyrussalem","followers_url":"https://api.github.com/users/cyrussalem/followers","following_url":"https://api.github.com/users/cyrussalem/following{/other_user}","gists_url":"https://api.github.com/users/cyrussalem/gists{/gist_id}","starred_url":"https://api.github.com/users/cyrussalem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cyrussalem/subscriptions","organizations_url":"https://api.github.com/users/cyrussalem/orgs","repos_url":"https://api.github.com/users/cyrussalem/repos","events_url":"https://api.github.com/users/cyrussalem/events{/privacy}","received_events_url":"https://api.github.com/users/cyrussalem/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-05-09T14:05:14Z","updated_at":"2016-05-10T07:50:07Z","closed_at":"2016-05-10T07:50:07Z","body":"Rather try this:\r\nObject.defineProperty(String.prototype, 'toProperCase', {\r\n    value: function toProperCase() {\r\n      return this.replace(/\\w\\S*/g, function (txt) {\r\n        return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();\r\n      });\r\n    },\r\n    configurable: false,\r\n    enumerable: false\r\n  });\r\n"}}