I get an error message if I want to find out in Cloud Script if the first or the last character in a string is a white space:
handlers.VerifyTextSpaceBeginningEndPassword = function (args, context) { var text = args.text; var notSupportArray = new Array(); for (var i = text.length - 1; i >= 0; i--) { var charCode = text.charCodeAt(i); if ((i = text.length - 1) || (i == 0)) { if (charCode == 32) { notSupportArray.push(charCode); } } } if (notSupportArray.length == 0) { return true; } else { return false; } }
What is wrong? Why am I getting "CloudScriptExecutionTimeLimitExceeded" error message?
"Error": { "Error": "CloudScriptExecutionTimeLimitExceeded", "Message": "The script execution was terminated after the maximum execution time limit", "StackTrace": null }