I want to use this
in a callback function in a prototype method eg.:
String.prototype.new= function (data) {
'use strict';
//here I can use 'this'
Object.getOwnPropertyNames(data).forEach(function (d) {
//here I want to use 'this' but I can't
});
};
See the comments above: How do I use this
within the callback?