]> Raphaƫl G. Git Repositories - youtubedl/blob - test/swftests/ArrayAccess.as
debian/copyright: Use HTTPS for upstream's source.
[youtubedl] / test / swftests / ArrayAccess.as
1 // input: [["a", "b", "c", "d"]]
2 // output: ["c", "b", "a", "d"]
3
4 package {
5 public class ArrayAccess {
6 public static function main(ar:Array):Array {
7 var aa:ArrayAccess = new ArrayAccess();
8 return aa.f(ar, 2);
9 }
10
11 private function f(ar:Array, num:Number):Array{
12 var x:String = ar[0];
13 var y:String = ar[num % ar.length];
14 ar[0] = y;
15 ar[num] = x;
16 return ar;
17 }
18 }
19 }