While i was trying to understand prototype behavior,
i wrote this sample code:
function MyString() {
}
MyString.protot ype = new String()
var a=new MyString("aaaaa ");
alert(a.valueOf ());
When i run this code on Firefox it raise an error like this:
String.prototyp e.valueOf called on incompatible object.
Can someone help me to understand what happens and why this code
does not work.
Thanks a lot and sorry for my english.
i wrote this sample code:
function MyString() {
}
MyString.protot ype = new String()
var a=new MyString("aaaaa ");
alert(a.valueOf ());
When i run this code on Firefox it raise an error like this:
String.prototyp e.valueOf called on incompatible object.
Can someone help me to understand what happens and why this code
does not work.
Thanks a lot and sorry for my english.
Comment