- From: Max Polk <maxpolk@gmail.com>
- Date: Fri, 27 Dec 2013 12:51:32 -0500
- To: Eliezer Bernart <eliezer.bernart@gmail.com>
- CC: Julee Burdekin <jburdeki@adobe.com>, Webplatform List <public-webplatform@w3.org>, Douglas Schepers <schepers@w3.org>
- Message-ID: <52BDBE24.30008@gmail.com>
On 12/25/2013 11:06 PM, Eliezer Bernart wrote: > /*Prototype* > / > /* A basic sample of different prototypes to the object./ I have a change of heart. It feels that we should not use the word "Prototype" to describe examples at the top. While the word "prototype" in English means one thing, it has a very different meaning in JavaScript, and we will cause confusion and lots of questions doing so. Let us use another word, perhaps Example. Also, I feel we should merge JS_Protype and JS_Parameter since they contextually are highly coupled What would you think of this. BEFORE (simple mediawiki text): arrayObj = new Array() arrayObj = new Array([ size ]) arrayObj = new Array([ element0 [, element1 [, ...[, elementN ]]]]) arrayObj: Required. The variable name to which the '''Array''' object is assigned. size: Optional. The size of the array. As arrays are zero-based, created elements will have indexes from zero to size -1. element0,...,elementN: Optional. The elements to place in the array. This creates an array with n + 1 elements, and a '''length''' of n + 1. Using this syntax, you must supply more than one element. AFTER (three examples, each with their independent set of parameters): {{JS_Example | Example=arrayObj = new Array() | Parameter1=arrayObj: Required. The variable name to which the '''Array''' object is assigned. }} {{JS_Example | Example=arrayObj = new Array([ size ]) | Parameter1=arrayObj: Required. The variable name to which the '''Array''' object is assigned. | Parameter2=size: Optional. The size of the array. As arrays are zero-based, created elements will have indexes from zero to size -1. }} {{JS_Example | Example=arrayObj = new Array([ element0 [, element1 [, ...[, elementN ]]]]) | Parameter1=arrayObj: Required. The variable name to which the '''Array''' object is assigned. | Parameter2=size: Optional. The size of the array. As arrays are zero-based, created elements will have indexes from zero to size -1. | Parameter3=element0,...,elementN: Optional. The elements to place in the array. This creates an array with n + 1 elements, and a '''length''' of n + 1. Using this syntax, you must supply more than one element. }} Some duplication, but since it's highly coupled, it makes it easier to add examples as independent units. Like? Dislike?
Received on Friday, 27 December 2013 17:51:59 UTC