JavaScript constructor Property
Complete Number Object Reference
Definition and Usage
The constructor property returns a reference to the Number function that created
the
object.
Syntax
Example 1
In this example we will show how to use the constructor property:
<script type="text/javascript">
var test=new Number();
if (test.constructor==Array)
{
document.write("This is an Array");
}
if (test.constructor==Boolean)
{
document.write("This is a Boolean");
}
if (test.constructor==Date)
{
document.write("This is a Date");
}
if (test.constructor==Number)
{
document.write("This is a Number");
}
</script>
|
The output of the code above will be:
Try-It-Yourself Demos
constructor - Number
In this example we will show how to use the constructor property.
Complete Number Object Reference
The Altova MissionKit is a suite of intelligent XML tools, including:
XMLSpy® – industry-leading XML editor
- Support for all XML-based technologies
- Graphical editing views, powerful debuggers, code generation, & more
MapForce® – graphical data mapping tool
- Drag-and-drop data conversion with code generation
- Support for XML, DBs, EDI, Excel® 2007, text, Web services
StyleVision® – visual stylesheet designer
- Drag-and-drop stylesheet design for XML & databases
- Output to HTML, PDF, RTF, Word 2007, & more
And more…
Try before you buy with a free fully functional 30-day trial
Download today
|