convert camelcase to sentence case javascript

JavaScript
var text = 'helloThereMister';
var result = text.replace( /([A-Z])/g, " $1" );
var finalResult = result.charAt(0).toUpperCase() + result.slice(1);
console.log(finalResult);convert camel case to string
Source

Also in JavaScript: