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) --- .../global_objects/object/constructor/index.html | 152 --------------------- 1 file changed, 152 deletions(-) delete mode 100644 files/ar/web/javascript/reference/global_objects/object/constructor/index.html (limited to 'files/ar/web/javascript/reference/global_objects/object/constructor') diff --git a/files/ar/web/javascript/reference/global_objects/object/constructor/index.html b/files/ar/web/javascript/reference/global_objects/object/constructor/index.html deleted file mode 100644 index 140d95a732..0000000000 --- a/files/ar/web/javascript/reference/global_objects/object/constructor/index.html +++ /dev/null @@ -1,152 +0,0 @@ ---- -title: Object.prototype.constructor -slug: Web/JavaScript/Reference/Global_Objects/Object/constructor -translation_of: Web/JavaScript/Reference/Global_Objects/Object/constructor ---- -
{{JSRef}}
- -

بالرجوع إلى {{jsxref("Object")}}constructor ووظيفتها إنشاء حالات من الاوبجكت (الكائن) .نذكرك بأن قيمة الخصائص التي تشير إليها تلك الفانكشان تشير لنفسها ولا تشير إلى سلسة تحتوي على إسم الفانكشان القيمة تقرأ فقط قيم بدائية مثل 1true و "test".

- -

الوصف

- -

جميع الاوبجكت ( مع بعض الاستثائات نشأت مع Object.create(null)  ) وستملك وقتها جميعا خاصية الـ constructor . اما  الكائنات المنشأة بدون إستخدام الكونستراكتور بشكل صريح ( مثل  object & array literals )  ستملك أيضا خصائص الكونستركتور بشكل أساسي

- -
var o = {};
-o.constructor === Object; // true
-
-var o = new Object;
-o.constructor === Object; // true
-
-var a = [];
-a.constructor === Array; // true
-
-var a = new Array;
-a.constructor === Array; // true
-
-var n = new Number(3);
-n.constructor === Number; // true
-
- -

أمثلة

- -

عرض الكونستركتور للأوبجكت

- -

في المثال التالي قمنا بإنشاء بروتوتيب Tree و اوبجكت بإسم theTree  المثال هنا يعرض خصائص الـconstructor للكائن theTree

- -
function Tree(name) {
-  this.name = name;
-}
-
-var theTree = new Tree('Redwood');
-console.log('theTree.constructor is ' + theTree.constructor);
-
- -

عندما تقوم بكتابة الكود بعالية  ستحصل على النتيجة الاتية ليوضح لك أكثر  :-

- -
theTree.constructor is function Tree(name) {
-  this.name = name;
-}
-
- -

تغير الكونستركتور الخاص بالاوبجكت

- -

The following example shows how to modify constructor value of generic objects. Only true, 1 and "test" will not be affected as they have read-only native constructors. This example shows that it is not always safe to rely on the constructor property of an object.

- -
function Type () {}
-
-var types = [
-  new Array(),
-  [],
-  new Boolean(),
-  true,             // remains unchanged
-  new Date(),
-  new Error(),
-  new Function(),
-  function () {},
-  Math,
-  new Number(),
-  1,                // remains unchanged
-  new Object(),
-  {},
-  new RegExp(),
-  /(?:)/,
-  new String(),
-  'test'            // remains unchanged
-];
-
-for (var i = 0; i < types.length; i++) {
-  types[i].constructor = Type;
-  types[i] = [types[i].constructor, types[i] instanceof Type, types[i].toString()];
-}
-
-console.log(types.join('\n'));
-
- -

This example displays the following output:

- -
function Type() {},false,
-function Type() {},false,
-function Type() {},false,false
-function Boolean() {
-    [native code]
-},false,true
-function Type() {},false,Mon Sep 01 2014 16:03:49 GMT+0600
-function Type() {},false,Error
-function Type() {},false,function anonymous() {
-
-}
-function Type() {},false,function () {}
-function Type() {},false,[object Math]
-function Type() {},false,0
-function Number() {
-    [native code]
-},false,1
-function Type() {},false,[object Object]
-function Type() {},false,[object Object]
-function Type() {},false,/(?:)/
-function Type() {},false,/(?:)/
-function Type() {},false,
-function String() {
-    [native code]
-},false,test
-
- -

Specifications

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SpecificationStatusComment
{{SpecName('ES1')}}{{Spec2('ES1')}}Initial definition. Implemented in JavaScript 1.1.
{{SpecName('ES5.1', '#sec-15.2.4.1', 'Object.prototype.constructor')}}{{Spec2('ES5.1')}} 
{{SpecName('ES6', '#sec-object.prototype.constructor', 'Object.prototype.constructor')}}{{Spec2('ES6')}} 
{{SpecName('ESDraft', '#sec-object.prototype.constructor', 'Object.prototype.constructor')}}{{Spec2('ESDraft')}} 
- -

دعم  المتصفحات

- -
- - -

{{Compat("javascript.builtins.Object.constructor")}}

-
-- cgit v1.2.3-54-g00ecf