In python, I can use tuples as the key to a dictionary. What's the equivalent in javascript?
>>> d = {}
>>> d[(1,2)] = 5
>>> d[(2,1)] = 6
>>> d
{(1, 2): 5, (2, 1): 6}
For those who are interested, I have two arrays...
positions = ...
normals = ...
I need to make a third array of position/normal pairs, but don't want to have duplicate pairs. My associative array would let me check to see if I have an existing [(posIdx,normalIdx)] pair to reuse or create one if I don't.
I need some way of indexing using a two-value key. I could just use a string, but that seems a bit slower than two numbers.