Occasionally my api spits out this error​ when using slice() javascript method

Not applicable
The error comes and goes.

{
    "fault": {
        "faultstring": "Execution of ModifyResponse failed with error: Javascript runtime error: \"TypeError: Cannot call method \"slice\" of undefined. (ModifyResponse.js:29)\"",
        "detail": {
            "errorcode": "steps.javascript.ScriptExecutionFailed"
        }
    }
}


0 1 134
1 REPLY 1

Welcome to the community !

That could be because the object on which the method is being called is not defined/set. Try including a check in your code before calling slice()