How can I access a sibling property from a method in Javascript? It seems like a simple thing to want to do, but I haven't found a way. Specifically, consider the following code.
let f = {
a: 3,
printMyBrother() { console.log(X) }
}.printMyBrother
f()
What must I change X to in the above code, in order to programatically log "3" on the console?
o) and referenceo.afwere your object and you calledf.printMyBrother(), you could usethis.abut since you're referring directly to theprintMyBrotherfunction, all context of that original object is lost