Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

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

New Here ,
Aug 22, 2021 Aug 22, 2021

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.

TOPICS
JavaScript
1.2K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
2 ACCEPTED SOLUTIONS
Community Expert ,
Aug 23, 2021 Aug 23, 2021

includes is not implemented.

View solution in original post

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 23, 2021 Aug 23, 2021
LATEST

Use indexOf instead, like this:

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

View solution in original post

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 23, 2021 Aug 23, 2021

includes is not implemented.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 23, 2021 Aug 23, 2021
LATEST

Use indexOf instead, like this:

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines