views:

848

answers:

1

I started to test my web site on google chrome and 'cannot call method 'join' of null' appears when doing this:

    var sChoices = oQuestion.aChoiceRand.join("");

In IE and FF works well. What I'm trying to do with this code is to join all the 'aChoiceRand' array elements in a string without any separators. How can I solve this?

+2  A: 

The problem's cause must be earlier, when oQuestion.aChoiceRand gets assigned: you think it's assigned to an array (and apparently IE and FF agree with you), Chrome is telling you that it's null instead. We can't really help without seeing the code that's supposed to assign oQuestion.aChoiceRand its value...

Alex Martelli
I found the problem, my mistake, aChoiceRand was null. So the error tried to tell me that the array is null