Is it possible with vanilla JS to access a let that was defined inside a function that's inside a class, from another class?
A non-functional attempt
// file-1.js
export default class myClass1 {
function myFunction(){
let myVariable = 'Hello'
}
}
// file-2.js
import myClass1 from "./file-1";
export default class myClass2 {
function printClass1(){
// Print 'Hello'?
console.log(myClass1.myFunction().myVariable)
}
}
I could find many answers on how it's done for other languages like C# and Python, but not for Vanilla Javascript