Please first execute the two parts codes in one group then think about why ?
1.
function g(){ return 23; };
var f = g;
typeof g();
VS
var f = function g(){ return 23; };
typeof g();
2.
function fun1(para){
this.testNumber = para;
}
function fun2(para){
this.testString = para;
}
fun1.prototype = new fun2("stringvalue");
var myf1 = new fun1(3);
var v = myf1.testNumber;
var s = myf1.testString;
console.log(v+"~"+s+"~"+typeof fun1.prototype);
VS
function fun1(para){
this.testNumber = para;
}
function fun2(para){
this.testString = para;
}
//fun1.prototype = new fun2("stringvalue");
var myf1 = new fun1(3);
var v = myf1.testNumber;
var s = myf1.testString;
console.log(v+"~"+s+"~"+typeof fun1.prototype);