Javascript.RU

PHP-функция: array_pop

Javascript:

function array_pop( array ) {	// Pop the element off the end of array
	// 
	// +   original by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)

	// done popping, are we?
	if( !array.length ){
		return null;
	}

	return array.pop();
}

Примеры:

array_pop([0,1,2]);
2