So you nest includes() which loops thru array2 inside forEach(), which is not ideal in terms of time complexity if you have a huge amount of items in your arrays.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Hi Mike yes you totally can use
includes()
however it would make the function not algorithm-wise because you gotta nest one loop inside another:So you nest
includes()
which loops thru array2 insideforEach()
, which is not ideal in terms of time complexity if you have a huge amount of items in your arrays.