Scenario (1)
var jk = function(name,age,lastanme){
this.name = name;
this.age = age;
this.lastanme = lastanme;
}
var op = new jk("ravi",45,"kumar");
console.log(op);
Scenario (2)
var jk = (name,age,lastanme)=>{
this.name = name;
this.age = age;
this.lastanme = lastanme;
}
var op = new jk("santhosh",45,"kumar");
console.log(op);
*const op = new jk("sandy",56,"kumar"); ^
TypeError: jk is not a constructor
Why is the second program with the arrow function giving the error 'jk is not a constructor'?