I have an array scraped from a webpage:
myvar = document.querySelectorAll('#tblItineraryModuleStayDetail > tbody > tr')
Which in the console returns an array:
What I need to do is subset this array:
- Start from the 3rd item
- Then keep every odd number of items
So I need a subset of my var with items 3 and 5 in it.
I tried: myvar.slice(3,5)
. This returned error "Undefined is not a function"
Had I been successful I would have an array with 3 items. I'd then need to subset on keeping odd items in the array.
How do I subset for myvar so that I have a variable with items 3 and 5 left in it? If myvar was length 10. How would I subset it to include items 3, 5, 7, 9?