Accepted answer

I think you want to access

snpsObj[ snpList[0] ]

by using bracket notation, snpsObj.snpList[0] would try to get the "snpList" property of your snpsObj object.

Btw, instead of your for-in-loop to create the array with property names, you might want to use Object.keys (even if you need to shim it to support old browsers).

Related Articles