I'm writing a some NodeJS code that is being passed a Map Iterator. What is the correct way to examine a Javascript object to determine that it is a "Map Iterator"?
I've tried:
typeof myMap.keys() returns 'Object'
typeof myMap.keys().next === 'function' returns true
So I'm checking to see if the object being passed has a next() function. Is there a better way to do this?
The Chrome debugger the object is a Map Iterator, so I'm guessing there is a more correct Javascript way to do this.