Skip to main content
Participant
Aug 23, 2021 6:40 AM UTC
Answered

Acrobat SDK and Array.includes() debugger says that includes is not a function

Hello,

Im trying to use includes() to see if a value is in an array and the debugger is saying "mntb.includes is not a function"

An example of how Im trying to implement in code is:

mntb = ['1','2','3','4'];
if(mntb.includes('4')){
   mntb.splice(mntb.indexOf('4');
}

this is a simplification of what Im actually doing. but very basically Im just trying to see if a value is in an array and if it is remove it for purposes of having conditional logic in two different lists, I need to be able to remove the value from one list if its in the other.

This topic is closed to new replies. Start a new post to keep the conversation going.
try67
try67Correct answer
Community Expert
Aug 23, 2021 8:18 AM UTC

Use indexOf instead, like this:

if (mntb.indexOf('4')!=-1){

2 replies

try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
Aug 23, 2021 8:18 AM UTC

Use indexOf instead, like this:

if (mntb.indexOf('4')!=-1){

Translate
Bernd Alheit
Community Expert
Community Expert
Aug 23, 2021 7:06 AM UTC

includes is not implemented.

Translate