1
0
mirror of https://codeberg.org/polarisfm/youtube-dl synced 2024-11-05 09:54:32 +01:00
youtube-dl/test/swftests/ArrayAccess.as

20 lines
425 B
ActionScript
Raw Normal View History

2014-07-20 18:28:49 +02:00
// input: [["a", "b", "c", "d"]]
// output: ["c", "b", "a", "d"]
package {
public class ArrayAccess {
public static function main(ar:Array):Array {
var aa:ArrayAccess = new ArrayAccess();
return aa.f(ar, 2);
}
private function f(ar:Array, num:Number):Array{
var x:String = ar[0];
var y:String = ar[num % ar.length];
ar[0] = y;
ar[num] = x;
return ar;
}
}
}