ServiceNow Javascript substr deprecated
Import
·
Oct 17, 2023
·
article
(Vancouver version)
var password='hodljdsnw340949';
var len=9;
I would be inclined to replace this:
return password.substr(0, len);
with:
return password.substring(0, len);
or alternatively use a regex
(
var sRegexQ='/.{'+ len +'}/'var pattern= new SNC.Regex(sRegexQ);var result = pattern.match(password);
return(result);
View original source
http://www.cloudminus89.com/2023/10/servicenow-javascript-substr-deprecated.html