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) --- .../ar/web/javascript/reference/errors/index.html | 31 ---------- .../reference/errors/unexpected_type/index.html | 68 ---------------------- 2 files changed, 99 deletions(-) delete mode 100644 files/ar/web/javascript/reference/errors/index.html delete mode 100644 files/ar/web/javascript/reference/errors/unexpected_type/index.html (limited to 'files/ar/web/javascript/reference/errors') diff --git a/files/ar/web/javascript/reference/errors/index.html b/files/ar/web/javascript/reference/errors/index.html deleted file mode 100644 index c295fccea6..0000000000 --- a/files/ar/web/javascript/reference/errors/index.html +++ /dev/null @@ -1,31 +0,0 @@ ---- -title: JavaScript error reference -slug: Web/JavaScript/Reference/Errors -tags: - - Debugging - - Error - - Errors - - Exception - - JavaScript - - NeedsTranslation - - TopicStub - - exceptions -translation_of: Web/JavaScript/Reference/Errors ---- -

{{jsSidebar("Errors")}}

- -

Below, you'll find a list of errors which are thrown by JavaScript. These errors can be a helpful debugging aid, but the reported problem isn't always immediately clear. The pages below will provide additional details about these errors. Each error is an object based upon the {{jsxref("Error")}} object, and has a name and a message.

- -

Errors displayed in the Web console may include a link to the corresponding page below to help you quickly comprehend the problem in your code.

- -

List of errors

- -

In this list, each page is listed by name (the type of error) and message (a more detailed human-readable error message). Together, these two properties provide a starting point toward understanding and resolving the error. For more information, follow the links below!

- -

{{ListSubPages("/en-US/docs/Web/JavaScript/Reference/Errors")}}

- -

See also

- - diff --git a/files/ar/web/javascript/reference/errors/unexpected_type/index.html b/files/ar/web/javascript/reference/errors/unexpected_type/index.html deleted file mode 100644 index 085dc8a167..0000000000 --- a/files/ar/web/javascript/reference/errors/unexpected_type/index.html +++ /dev/null @@ -1,68 +0,0 @@ ---- -title: 'TypeError: "x" is (not) "y"' -slug: Web/JavaScript/Reference/Errors/Unexpected_type -tags: - - الأخطاء - - جافاسكربت - - نوع الخطأ -translation_of: Web/JavaScript/Reference/Errors/Unexpected_type ---- -
{{jsSidebar("Errors")}}
- -

الرسالة

- -
TypeError: Unable to get property {x} of undefined or null reference (Edge)
-TypeError: "x" is (not) "y" (Firefox)
-
-Examples:
-TypeError: "x" is undefined
-TypeError: "x" is null
-TypeError: "undefined" is not an object
-TypeError: "x" is not an object or null
-TypeError: "x" is not a symbol
-
- -

نوع الخطأ

- -

{{jsxref("TypeError")}}.

- -

 ماذا حصل؟

- -

خطأ غير متوقع، يحدث كثيرا مع {{jsxref("undefined")}} أو قيم {{jsxref("null")}} .

- -

أيضا في بعض الوضائف مثل {{jsxref("Object.create()")}} أو {{jsxref("Symbol.keyFor()")}}, تحتاج تقديد أنواع محددة.

- -

أمثلة

- -

حالات غير صحيحة

- -
// undefined and null cases on which the substring method won't work
-var foo = undefined;
-foo.substring(1); // TypeError: foo is undefined
-
-var foo = null;
-foo.substring(1); // TypeError: foo is null
-
-
-// Certain methods might require a specific type
-var foo = {}
-Symbol.keyFor(foo); // TypeError: foo is not a symbol
-
-var foo = 'bar'
-Object.create(foo); // TypeError: "foo" is not an object or null
-
- -

حل المشكلة

- -

لإصلاح مؤشر null إلى قيم undefined أو null ، يمكنك استخدام عامل التشغيل typeof ، على سبيل المثال.

- -
if (typeof foo !== 'undefined') {
-  // الآن نعلم أن القيمة المدخلة غير محددة، نستطيع القيام بأي إجراء بدون خطأ.
-}
- -

شاهد أيضاً

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