Log value of DeviceID

gaah! I need some help from those of you who actually know how to code…

log (“productclass check”);
const now = Date.now();

let productclass = declare(“DeviceID.ProductClass”, null, {value : now });
log(productclass.value);
log (“productclass check done”);

This works kinda, but returns more than I’d want to(I’ve cat’ed the output somewhat) :
Script: productclass check
Script: Polar,xsd:string <- This! I’m trying to get the string value without “,xsd:string”
Script: productclass check done

EDIT: I figured it out when I read the old docs…

log (“productclass check”);
const now = Date.now();
let productclass = declare(“DeviceID.ProductClass”, {value: now}).value[0];
log(productclass);
log (“productclass check done”);

To expand on this:
What kind of JS methods are available in the provisions? I thought about using trim() or replace(), but these aren’t available (or, I’m not a coder and don’t know how to do it…) :slight_smile:

I guess I can do it with a regex somewhere, but is there a simpler way? I’m using it as a proof of concept in the example above, I just wanted to see what was actually returned in order to use it in functions to check the state of a cpe.