0

I am facing a bit weird problem while splitting out a string in jQuery. For some reason I am getting following exception

TypeError: Object [object Array] has no method 'split'

i have attached one image that displays the data n exception on browser. nenter image description here

Code Snippet:

**skill List contains [Array[4], Array[4], Array[4], Array[4], 

Array[4], Array[4], Array[4], Array[4], Array[4], Array[4], Array[4]] and every array has following structure** 0: Array[4] 0: "NWDS" 1: "NWDS " 2: 1 3: 1 length: 4**

  $.each(skillsList, function(index, item) {
                var array = skillsList[index].split(',');

                });

1 Answer 1

3

skillList[index] is an Array[4]. Arrays do not have the split function and therefore you're getting an error. You'll have to access one of the indeces of skillList[index] (eg skillList[index][innerIndex] in order to reach a String.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.