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.
Copy link to clipboard
Copied
includes is not implemented.
Copy link to clipboard
Copied
Copy link to clipboard
Copied
includes is not implemented.
Copy link to clipboard
Copied
Use indexOf instead, like this:
if (mntb.indexOf('4')!=-1){
Find more inspiration, events, and resources on the new Adobe Community
Explore Now