[program-l] array.splice is not a function?

  • From: Erik Burggraaf <burggraaferik@xxxxxxxxx>
  • To: program-l@xxxxxxxxxxxxx
  • Date: Tue, 11 Jan 2022 13:42:09 -0500

Hi all,  I just tried to remove items from an array of html elements using
splice() and got this error that array.splice is not a function.  Any idea
why?  I've read four or five articles but nothing illuminating.

My situation is that I wanted to get elements by tag name so that I didn't
have to use a custom class.  So I swept the elements into an array and they
work just fine.  Unfortunately, there were more of the same, in this case
articles in my production environment than there are in my test
environment.  I don't need the extra ones, so thought splice would be an
easy way to pull them out.

I looped through the array, testing a condition.  If they meet the
condition they get pulled out.  Otherwise they stay.

But the splice method is not a function or so I'm told by my error console.

Any suggestions very much appreciated as always.

Thanks,

Erik

Other related posts: