Extract Element From Array Javascript Function Call