diff options
author | Ryan Johnson <rjohnson@mozilla.com> | 2021-04-29 16:16:42 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-29 16:16:42 -0700 |
commit | 95aca4b4d8fa62815d4bd412fff1a364f842814a (patch) | |
tree | 5e57661720fe9058d5c7db637e764800b50f9060 /files/ar/web/javascript/reference/global_objects/object/constructor | |
parent | ee3b1c87e3c8e72ca130943eed260ad642246581 (diff) | |
download | translated-content-95aca4b4d8fa62815d4bd412fff1a364f842814a.tar.gz translated-content-95aca4b4d8fa62815d4bd412fff1a364f842814a.tar.bz2 translated-content-95aca4b4d8fa62815d4bd412fff1a364f842814a.zip |
remove retired locales (#699)
Diffstat (limited to 'files/ar/web/javascript/reference/global_objects/object/constructor')
-rw-r--r-- | files/ar/web/javascript/reference/global_objects/object/constructor/index.html | 152 |
1 files changed, 0 insertions, 152 deletions
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 ---- -<div dir="rtl">{{JSRef}}</div> - -<p dir="rtl">بالرجوع إلى {{jsxref("Object")}}constructor ووظيفتها إنشاء حالات من الاوبجكت (الكائن) .نذكرك بأن قيمة الخصائص التي تشير إليها تلك الفانكشان تشير لنفسها ولا تشير إلى سلسة تحتوي على إسم الفانكشان القيمة تقرأ فقط قيم بدائية مثل <code>1</code>, <code>true</code> و <code>"test"</code>.</p> - -<h2 dir="rtl" id="الوصف">الوصف</h2> - -<p dir="rtl">جميع الاوبجكت ( مع بعض الاستثائات نشأت مع <code>Object.create(null)</code> ) وستملك وقتها جميعا خاصية الـ <code>constructor </code>. اما الكائنات المنشأة بدون إستخدام الكونستراكتور بشكل صريح ( مثل object & array literals ) ستملك أيضا خصائص الكونستركتور بشكل أساسي</p> - -<pre class="brush: js">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 -</pre> - -<h2 dir="rtl" id="أمثلة">أمثلة</h2> - -<h3 dir="rtl" id="عرض_الكونستركتور_للأوبجكت">عرض الكونستركتور للأوبجكت</h3> - -<p dir="rtl">في المثال التالي قمنا بإنشاء بروتوتيب <code>Tree </code>و اوبجكت بإسم <code>theTree</code> المثال هنا يعرض خصائص الـ<code>constructor</code> للكائن <code>theTree</code></p> - -<pre class="brush: js" dir="rtl">function Tree(name) { - this.name = name; -} - -var theTree = new Tree('Redwood'); -console.log('theTree.constructor is ' + theTree.constructor); -</pre> - -<p dir="rtl">عندما تقوم بكتابة الكود بعالية ستحصل على النتيجة الاتية ليوضح لك أكثر :-</p> - -<pre class="brush: js">theTree.constructor is function Tree(name) { - this.name = name; -} -</pre> - -<h3 dir="rtl" id="تغير_الكونستركتور_الخاص_بالاوبجكت">تغير الكونستركتور الخاص بالاوبجكت</h3> - -<p>The following example shows how to modify constructor value of generic objects. Only <code>true</code>, <code>1</code> and <code>"test"</code> will not be affected as they have read-only native constructors. This example shows that it is not always safe to rely on the <code>constructor</code> property of an object.</p> - -<pre class="brush:js">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')); -</pre> - -<p>This example displays the following output:</p> - -<pre class="brush: js">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 -</pre> - -<h2 id="Specifications">Specifications</h2> - -<table class="standard-table"> - <tbody> - <tr> - <th scope="col">Specification</th> - <th scope="col">Status</th> - <th scope="col">Comment</th> - </tr> - <tr> - <td>{{SpecName('ES1')}}</td> - <td>{{Spec2('ES1')}}</td> - <td>Initial definition. Implemented in JavaScript 1.1.</td> - </tr> - <tr> - <td>{{SpecName('ES5.1', '#sec-15.2.4.1', 'Object.prototype.constructor')}}</td> - <td>{{Spec2('ES5.1')}}</td> - <td> </td> - </tr> - <tr> - <td>{{SpecName('ES6', '#sec-object.prototype.constructor', 'Object.prototype.constructor')}}</td> - <td>{{Spec2('ES6')}}</td> - <td> </td> - </tr> - <tr> - <td>{{SpecName('ESDraft', '#sec-object.prototype.constructor', 'Object.prototype.constructor')}}</td> - <td>{{Spec2('ESDraft')}}</td> - <td> </td> - </tr> - </tbody> -</table> - -<h2 dir="rtl" id="دعم_المتصفحات">دعم المتصفحات</h2> - -<div> - - -<p>{{Compat("javascript.builtins.Object.constructor")}}</p> -</div> |