I am trying for a while to switch constructor for a object and I am failing. Continuing code will show example of what I need. Thanks.
<script type="text/javascript">
function Me(){
this.name = "Dejan";
}
function You(){
this.name = "Ivan";
}
Me.prototype.constructor = You;
somebody = new Me();
alert(somebody.name); // **It gives Dejan, and I am expecting Ivan**
</script>