10.02.2018 Views

js_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 />

constructor<br />

It returns a reference to the Number function that created the instance's<br />

prototype.<br />

Syntax<br />

Its syntax is as follows:<br />

number.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 constructor() Method<br />

<br />

<br />

<br />

var num = new Number( 177.1234 );<br />

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

<br />

<br />

<br />

Output<br />

num.constructor() is : function Number() { [native code] }<br />

Number Methods<br />

The Number object contains only the default methods that are a part of every<br />

object's definition.<br />

Method<br />

Description<br />

toExponential() Forces a number to display in exponential notation, even if<br />

120

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

Saved successfully!

Ooh no, something went wrong!