i have following function to make the value of control Initial capital.
ctrl.value = ctrl.value.toLowerCase().replace( /\b[a-z]/g , function {
return arguments[0].toUpperCase();
});
When i run this in browser i get the following error in console
SyntaxError: missing ( before formal parameters
whats wrong with the syntax.
Solved by changing function { to function () {