Linkedhashset To Arraylist Using Toarray Javascript Function Definition