JavaScript constructor Property
Complete Date Object Reference
Definition and Usage
The constructor property returns a reference to the Date 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 Date();
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==String)
{
document.write("This is a String");
}
</script>
|
The output of the code above will be:
Try-It-Yourself Demos
constructor - Date
In this example we will show how to use the constructor property.
Complete Date Object Reference
Learn XML with <oXygen/> XML Editor - Free Trial!
|
|
oXygen helps you learn to define,
edit, validate and transform XML documents. Supported technologies include XML Schema,
DTD, Relax NG, XSLT, XPath, XQuery, CSS.
Understand in no time how XSLT and XQuery work by using the intuitive oXygen debugger!
Do you have any XML related questions? Get free answers from the oXygen
XML forum
and from the video
demonstrations.
Download a FREE 30-day trial today!
|
|