Sponsors

Web Designer? Design and market your own professional website with easy-to-use tools.

Compare, review and buy thousands of Laptops , software products at CheckCost.co.uk

Your Text Link Here! and your text description here!

Javascript constructor property

The string object of javascript allows you to manipulate a stored piece of text.

The constructor property is a reference to the function that created the object.

The javascript code below shows you how to use the constructor property.

<script type="text/javascript" language="javascript">

var test=new String();
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 javascript code above outputs "This is a string".

Free Website Hosting

WebDevelopmentTutorials.com