ForNext
Only Do What Only You Can Do
104. manipulate front
Hyperpolyglot Interpreted Languages: PHP, Perl, Python, Ruby より (2012.05.08)
VBScript
JScript
Perl
@a = (6,7,8); unshift @a, 5; shift @a;
PHP
$a = array(6,7,8); array_unshift($a, 5); array_shift($a);
Python
a = [6,7,8] a.insert(0,5) a.pop(0)
Ruby
a = [6,7,8] a.unshift(5) a.shift