aboutsummaryrefslogtreecommitdiff
path: root/files/vi/conflicting/web/javascript/reference/global_objects/promise/index.html
diff options
context:
space:
mode:
authorFlorian Merz <me@fiji-flo.de>2021-02-11 14:51:56 +0100
committerFlorian Merz <me@fiji-flo.de>2021-02-11 14:51:56 +0100
commit904a5994c87295d84d25f869d5555f35fbce5070 (patch)
treea8535dfa32d2180186965a0bb66931b4830c5d73 /files/vi/conflicting/web/javascript/reference/global_objects/promise/index.html
parent8260a606c143e6b55a467edf017a56bdcd6cba7e (diff)
downloadtranslated-content-904a5994c87295d84d25f869d5555f35fbce5070.tar.gz
translated-content-904a5994c87295d84d25f869d5555f35fbce5070.tar.bz2
translated-content-904a5994c87295d84d25f869d5555f35fbce5070.zip
unslug vi: move
Diffstat (limited to 'files/vi/conflicting/web/javascript/reference/global_objects/promise/index.html')
-rw-r--r--files/vi/conflicting/web/javascript/reference/global_objects/promise/index.html65
1 files changed, 65 insertions, 0 deletions
diff --git a/files/vi/conflicting/web/javascript/reference/global_objects/promise/index.html b/files/vi/conflicting/web/javascript/reference/global_objects/promise/index.html
new file mode 100644
index 0000000000..9fb94f4154
--- /dev/null
+++ b/files/vi/conflicting/web/javascript/reference/global_objects/promise/index.html
@@ -0,0 +1,65 @@
+---
+title: Promise.prototype
+slug: Web/JavaScript/Reference/Global_Objects/Promise/prototype
+translation_of: Web/JavaScript/Reference/Global_Objects/Promise
+translation_of_original: Web/JavaScript/Reference/Global_Objects/Promise/prototype
+---
+<div>{{JSRef}}</div>
+
+<p>Thuộc tính <code><strong>Promise</strong></code><strong><code>.prototype</code></strong> biểu diễn nguyên mẫu (prototype) cho hàm khởi tạo của {{jsxref("Promise")}}.</p>
+
+<div>{{js_property_attributes(0,0,0)}}</div>
+
+<h2 id="Mô_tả">Mô tả</h2>
+
+<p>Mỗi đối tượng {{jsxref("Promise")}} được kế thừa từ {{jsxref("Promise.prototype")}}. Ta có thể sử dụng nguyên mẫu của hàm khởi tạo để thêm vào các thuộc tính hoặc phương thức mới cho đối tượng <code>Promise</code>.</p>
+
+<h2 id="Thuộc_tính">Thuộc tính</h2>
+
+<dl>
+ <dt><code>Promise.prototype.constructor</code></dt>
+ <dd>Trả ra hàm khởi tạo một nguyên mẫu đối tượng. Mặc định là hàm {{jsxref("Promise")}}.</dd>
+</dl>
+
+<h2 id="Phương_thức">Phương thức</h2>
+
+<dl>
+ <dt>{{jsxref("Promise.catch", "Promise.prototype.catch(onRejected)")}}</dt>
+ <dd>Thêm một hàm phản hồi lỗi cho promise và trả ra một promise mới chứa kết quả được truyền vào hàm phản hồi đó sau khi thao tác xử lý của promise kết thúc.</dd>
+ <dt>{{jsxref("Promise.then", "Promise.prototype.then(onFulfilled, onRejected)")}}</dt>
+ <dd>Thêm một hàm phản hồi (có thể là thành công hoặc thất bại) và trả ra một promise mới chứa kết quả là kết quả thực thi của promise sau khi tác vụ kết thúc. Trong đó onFulfilled sẽ có đầu vòa là kết quả xử lý thành công, còn onRejected có đầu vòa là kết quả xử lý thất bại.</dd>
+</dl>
+
+<h2 id="Đặc_tả">Đặc tả</h2>
+
+<table class="standard-table">
+ <tbody>
+ <tr>
+ <th scope="col">Đặc tả</th>
+ <th scope="col">Trạng thái</th>
+ <th scope="col">Ghi chú</th>
+ </tr>
+ <tr>
+ <td>{{SpecName('ES6', '#sec-promise.prototype', 'Promise.prototype')}}</td>
+ <td>{{Spec2('ES6')}}</td>
+ <td>Initial definition.</td>
+ </tr>
+ <tr>
+ <td>{{SpecName('ESDraft', '#sec-promise.prototype', 'Promise.prototype')}}</td>
+ <td>{{Spec2('ESDraft')}}</td>
+ <td> </td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="Trình_duyệt_tương_thích">Trình duyệt tương thích</h2>
+
+<p class="hidden">To contribute to this compatibility data, please write a pull request against this file: <a href="https://github.com/mdn/browser-compat-data/blob/master/javascript/promise.json">https://github.com/mdn/browser-compat-data/blob/master/javascript/promise.json</a>.</p>
+
+<p>{{Compat}}</p>
+
+<h2 id="See_also">See also</h2>
+
+<ul>
+ <li>{{jsxref("Promise")}}</li>
+</ul>