What is the difference between these functions? And what are the advantages and disadvantages?
let Test = function(name) {
this.name = name;
this.complete = function() {
console.log(`completing task${this.name}`)
}
}
and
let Test = function(name) {
this.name = name;
}
Test.prototype.complete = function() {
console.log(`completing task${this.name}`)
}