Challenge:
I am facing an issue where I have a series of numerical values separated by commas that I need to convert into an array. Each pair of values should be nested within the main array to represent drawing vertices.
How can I tackle this challenge effectively?
Data Input:
var vertices = "24,13,47,20,33,9,68,18,99,14,150,33,33,33,34,15,91,10";
The desired output should look like this:
Expected Output:
var V_array = [[24,13],[47,20],[33,9],[68,18],[99,14],[150,33],[33,33],[34,15],[91,10]];