String.includes failing

uuid: 9cb198d3b8b94e5f8326d3a1aad47446

using a script to pad zeroes on the beginning of an ID. In that I’m using a string.includes to search for a substring. works fine in the browser but fails in the automation.

no idea why here.

edit: log of the error.

Javascript that runs on the server in an automation is not equivalent to Javascript that runs in the browser. I’ve never heard of “String.includes”, which means it is probably new and something that the server-side Javascript engine doesn’t support.

ok. do you know what would be the proper call for searching a string for a substring?

I use indexOf(), e.g. “test”.indexOf(“es”)

ok that works. thanks