10.07.2017 Views

javascript_tutorial

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Javascript<br />

input<br />

length<br />

prototype<br />

This property is only present in arrays created by<br />

regular expression matches.<br />

Reflects the number of elements in an array.<br />

The prototype property allows you to add properties<br />

and methods to an object.<br />

In the following sections, we will have a few examples to illustrate the usage of<br />

Array properties.<br />

constructor<br />

Javascript array constructor property returns a reference to the array function<br />

that created the instance's prototype.<br />

Syntax<br />

Its syntax is as follows:<br />

array.constructor<br />

Return Value<br />

Returns the function that created this object's instance.<br />

Example<br />

Try the following example.<br />

<br />

<br />

JavaScript Array constructor Property<br />

<br />

<br />

<br />

var arr = new Array( 10, 20, 30 );<br />

document.write("arr.constructor is:" + arr.constructor);<br />

<br />

<br />

<br />

178

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!