함수 pop()

(함수 array pop()에서 넘어옴)
array_pop
pop

1 JavaScript[ | ]

var fruits = ["Banana", "Orange", "Apple", "Mango"];
var fruit = fruits.pop();
console.log( fruit );
// Mango
console.log( fruits );
// ["Banana", "Orange", "Apple"]

2 PHP[ | ]

$arr = ['A', 'B', 'C'];
$str = array_pop($arr);
print_r($str);
# C
print_r($arr);
# Array
# (
#     [0] => A
#     [1] => B
# )

3 Python[ | ]

arr = ['A', 'B', 'C']
str = arr.pop()
print( str )
# C
print( arr )
# ['A', 'B']
arr = ['A', 'B', 'C']
str = arr.pop(1)
print( str )
# B
print( arr )
# ['A', 'C']

4 Perl[ | ]

my @arr = ('A', 'B', 'C');
my $str = pop @arr;
print $str . "\n";
# C
print @arr;
# AB

5 같이 보기[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}