ARTICLE AD BOX
String.prototype.test= () => {
return `----${this}----`;
};
let myStr = "hello";
console.log(myStr.test()); // returns window object
// --------------------------------------------------------------------
String.prototype.testing= function() {
return `----${this}----`;
};
let myStr1 = "hello";
console.log(myStr.testing()); // returns myStr1
my question is what makes the arrow functions don't have a "this" for themself ? all i know is syntax i don't know actual difference between and when to use arrow and when its better to use normal one.
