I have been following javascript tutorial from www.w3school.com and while reading one of the examples i have got one question in my mind, the code is as follows:
<html> <body> <script type="text/javascript"> var txt =new String ("Hello World!"); document.write(txt.constructor); </script> </body> </html> Now, iam getting in response of this code is :
function String() { [native code] } However, according to me the constructor must have a parameter in it somewhat like this:
function string(value){} Can anybody please tell me why it is returning the constructor with no parameter.