The Now Platform® Washington DC release is live. Watch now!
Did you know that your Service-now instance comes complete with a handy-dandy set of commonly used JavaScript utility methods? These are in a script include named "JSUtil", and you can easily use its methods in your scripts.
For example, there's a method named "nil()" (along with "notNil()" that lets you easily test whether a value is null, undefined, or an empty string. You might use it in your own code it like this:
function myFunc(val) {
if (JSUtil.nil(val))
return null;
return 'My prefix: ' + val;
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.