I am somewhat new to Javascript, and I am trying to make a library for myself, so I dont have to code it in later. I have this code (below).
function lib() {
let _this = this;
this.addstring= (n, d) => {
return n + d
}
}
console.log(lib.addstring("foo", "bar"))
When the code above is ran, it tells me that lib.addstring
is not a function. How would I be able to write this as a function?