I write a python function that return array, the array is python array [(str1, str2, str3), (str1, str2, str3)], and I want to loop it to get every item on array. I have try this:
for (var (a, b, c) in arrayItem) {
$(#id).append(a);
}
But it return integer, not string.
This topic was modified 10 years, 1 month ago by joe hartono. Reason: Unclear explaination
Pythonic expression (array of tuples): tuples = [(str1, str2, str3), (str1, str2, str3)]
in JS/TS is an array of arrays: var tuples = [[str1, str2, str3], [str1, str2, str3]]
If you want to enumerate first element of each tuple then you should do this:
for (var tuple in tuples)
$(#id).append(tuple[0]); // using first element of the tuple