Is there a better way to access the class level vars from the class itself from within a called function in the same class? While this works it feels like there should be a better way without instantiating a complete copy of the class. If there were a pointer/by ref concept in js, that would be better. I realize js is just a scripting language.
class Cruds {
constructor() {
name = 'cruds'
this.Debug = false;
this.useAsync = true;
}
...
// In Cruds class
updateListItem(webUrl, listName, itemId, itemProperties, success, failure) {
let me = this; //My current solution
// Also in Cruds class
this.getListItemById(webUrl, listName, itemId, function (item) {
if (me.Debug === true) {
console.log("updateListItem: " + listName);
console.dir(itemProperties);
}
// another in Cruds class
me.cleanProperties(itemProperties);
...
My thanks in advance.