The Now Platform® Washington DC release is live. Watch now!
A string is a string, right? Ah, if only 'twas so!
JavaScript all by itself has two different kinds of strings: there's the primitive "string" (with a lower case 's') and then there's the "String" class (which you can create instances of. For example:
var x = 'this is a primitive string';
var y = new String('this is a String instance');
gs.log(x + ': ' + typeof x); // this will show typeof 'string'
gs.log(y + ': ' + typeof y); // this will show typeof 'object'
var id = Packages.com.glide.util.GlideUtil.getSystemId();
gs.log(id + ': ' + id.length());
id = '' + id;
gs.log(id + ': ' + id.length());
*** Script: bosdemo02.service-now.com:maelstrom_16079: 41
Evaluator: org.mozilla.javascript.EcmaError: 41 is not a function.
Caused by error in script at line 4
1: var id = Packages.com.glide.util.GlideUtil.getSystemId();
2: gs.log(id + ': ' + id.length());
3: id = '' + id;
==> 4: gs.log(id + ': ' + id.length());
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.