From 95aca4b4d8fa62815d4bd412fff1a364f842814a Mon Sep 17 00:00:00 2001 From: Ryan Johnson Date: Thu, 29 Apr 2021 16:16:42 -0700 Subject: remove retired locales (#699) --- .../reference/global_objects/array/pop/index.html | 96 ---------------------- 1 file changed, 96 deletions(-) delete mode 100644 files/vi/web/javascript/reference/global_objects/array/pop/index.html (limited to 'files/vi/web/javascript/reference/global_objects/array/pop') diff --git a/files/vi/web/javascript/reference/global_objects/array/pop/index.html b/files/vi/web/javascript/reference/global_objects/array/pop/index.html deleted file mode 100644 index b5740406a5..0000000000 --- a/files/vi/web/javascript/reference/global_objects/array/pop/index.html +++ /dev/null @@ -1,96 +0,0 @@ ---- -title: Array.prototype.pop() -slug: Web/JavaScript/Reference/Global_Objects/Array/pop -tags: - - JavaScript - - Mảng -translation_of: Web/JavaScript/Reference/Global_Objects/Array/pop ---- -
{{JSRef}}
- -

Phương thức pop() xoá phần tử cuối cùng của một mảng và trả về phần tử đó. Phương thức này làm thay đổi độ dài của mảng.

- -
{{EmbedInteractiveExample("pages/js/array-pop.html")}}
- - - -

Cú pháp

- -
arr.pop()
- -

Giá trị trả về

- -

Phần tử bị xoá từ mảng; {{jsxref("undefined")}} nếu mảng rỗng.

- -

Mô tả

- -

The pop method removes the last element from an array and returns that value to the caller.
- Phương thức pop xoá phần tử cuối cùng của một mảng và trả về giá trị đó cho lời gọi.

- -

pop is intentionally generic; this method can be {{jsxref("Function.call", "called", "", 1)}} ?or {{jsxref("Function.apply", "applied", "", 1)}} to objects resembling arrays. Objects which do not contain a length property reflecting the last in a series of consecutive, zero-based numerical properties may not behave in any meaningful manner.

- -

Nếu bạn gọi pop() trên một mảng rỗng, nó trả về {{jsxref("undefined")}}.

- -

Ví dụ

- -

Xoá phần tử cuối cùng của một mảng

- -

Đoạn mã sau tạo mảng myFish chứa 4 phần tử, sau đó xoá phần tử cuối cùng.

- -
var myFish = ['angel', 'clown', 'mandarin', 'sturgeon'];
-
-var popped = myFish.pop();
-
-console.log(myFish); // ['angel', 'clown', 'mandarin' ]
-
-console.log(popped); // 'sturgeon'
- -

Đặc tả

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Đặc tả?Trạng tháiGhi chú
{{SpecName('ES3')}}{{Spec2('ES3')}}Định nghĩa lần đầu. Cài đặt trong JavaScript 1.2.
{{SpecName('ES5.1', '#sec-15.4.4.6', 'Array.prototype.pop')}}{{Spec2('ES5.1')}} 
{{SpecName('ES6', '#sec-array.prototype.pop', 'Array.prototype.pop')}}{{Spec2('ES6')}} 
{{SpecName('ESDraft', '#sec-array.prototype.pop', 'Array.prototype.pop')}}{{Spec2('ESDraft')}} 
- -

Tương thích trình duyệt

- -
- - -

{{Compat("javascript.builtins.Array.pop")}}

-
- -

See also

- - -- cgit v1.2.3-54-g00ecf