ServiceNow Javascript substr deprecated
(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);
)
Comments
Post a Comment