I need to build repeat control or (view or data table) that uses scoped variable as data source. And the scoped variable should be an array.. Or even just javaScript array..
It's worth looking at java.util.ArrayList or java.util.HashMap. The first gives a one dimensional object, the second a two-dimensional. You'll probably get better typeahead support. HashMap may seem scary, but it's actually very familiar to you - scoped variables are HashMaps. myMap.keySet() is what to use as the "value" for your repeat, then assuming var="key" you can use myMap.get(key) to get the value.
If you want to use JavaScript objects, look at the video I did for TLCC's webinar last year of my 2013 IBM Connect session with Mike McGarel "It's Not Herculean...". I do exactly that.