JavaScript constructor problem

learn the constructor and encounter the following code when doing exercises

the code is as follows

function Fn(){
   return this;
}
Fn.prototype.getNum = function(){
    console.log(3);
};
new new Fn().getNum ();

Why is the output 3?

what I understand is the code new new Fn (). GetNum ();

var f = new Fn(); //=>  f 
new f.getNum();  //=>  fgetNum

Apr.06,2021

clipboard.png


fjs



MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1c22fe8-33652.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1c22fe8-33652.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?