Reply to
:
You already have the lines logging your values array, was it so hard to add lines logging the other vars?
c1_arr = c1.split(';');
The array created here is [‘font-color:#ff0000’, ‘'] - there is a blank second element since there’s nothing after the ‘;’ in the input string.
Then when you call:
values[1][i]= c1_arr[i].split(':');
c1_arr[1] is empty string, so values[1][1] is an array with only one element, empty string.
values[1][1][0] -> empty string values[1][1][1] -> undefined (no second element)
If you enjoyed my content for some reason, I'd love to hear from you! Here are some options:
- You can buy me a coffee!
- You can write a reply on your own site and submit the URL as a webmention via the form below.
- Or you can just contact me!