Sign In Register

How can we help you today?

Start a new topic

startsWith

I cannot use startsWith in cloud code like described on this page; http://www.w3schools.com/jsref/jsref_startswith.asp Is not javascript fully implemented on cloud code?
1 Comment

Hi Ufuk,


startsWith was initially defined in the ECMAScript 6 specification, and our Cloud Code engine, RhinoJS has not upgraded to ECMA6 as of yet.


Alternatives to startsWith include using the substring or lastIndexOf functions, as well as defining a regex for specific string patterns.


For example:


if (myString.substring(0, input.length) === input)


or


if (myString.lastIndexOf(input, 0) === 0)


-Pádraig

Login to post a comment