Im building a chrome extension that grabs a table of ingredients and compares it with a dataset.Since most nutrient table have a classname of "nutrition" im grabbing the via their className. This is what I got:
["\tPer 100g\tPer 35g Ball\nEnergy\t449kcal\t157kcal\nFat\t24.4g\t8.6g\nSaturated fat\t4.5g\t1.6g\nMonounsaturated fat\t13.6g\t4.8g\nPolyunsaturated fat\t5.2g\t1.8g\nTotal Carbohydrates\t31.0g\t10.9g\nSugars\t19.7g\t6.9g\nFibre\t6.1g\t2.1g\nProtein\t23.1g\t8.1g\nSalt\t0.71g\t0.25"]
i need to loop thru this array and return it in this format:

I was thinking of using Regex to split out the doses (so words) and numbers?