0
New Here
,
/t5/acrobat-discussions/acrobat-sdk-and-array-includes-debugger-says-that-includes-is-not-a-function/td-p/12333961
Aug 22, 2021
Aug 22, 2021
Copy link to clipboard
Copied
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
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
2 ACCEPTED SOLUTIONS
Community Expert
,
/t5/acrobat-discussions/acrobat-sdk-and-array-includes-debugger-says-that-includes-is-not-a-function/m-p/12333986#M325858
Aug 23, 2021
Aug 23, 2021
Copy link to clipboard
Copied
includes is not implemented.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Community Expert
,
LATEST
/t5/acrobat-discussions/acrobat-sdk-and-array-includes-debugger-says-that-includes-is-not-a-function/m-p/12334129#M325868
Aug 23, 2021
Aug 23, 2021
Copy link to clipboard
Copied
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Community Expert
,
/t5/acrobat-discussions/acrobat-sdk-and-array-includes-debugger-says-that-includes-is-not-a-function/m-p/12333986#M325858
Aug 23, 2021
Aug 23, 2021
Copy link to clipboard
Copied
includes is not implemented.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Community Expert
,
LATEST
/t5/acrobat-discussions/acrobat-sdk-and-array-includes-debugger-says-that-includes-is-not-a-function/m-p/12334129#M325868
Aug 23, 2021
Aug 23, 2021
Copy link to clipboard
Copied
Use indexOf instead, like this:
if (mntb.indexOf('4')!=-1){
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

