In LWC, is there any way to change the value of a variable that is located in another JS file & some other JS file changes that variable value which have impact on the first file variable? Regards

i.e. 1.js

myBoolean = false;


myBoolean = true;

thus assigning myBoolean = true; inside 2.js will also change the value for myBoolean inside 1.js?

  • Please edit this question to provide a code example and details of where you are working. The answer differs depending on whether you are working in Visualforce, Aura, LWC, and on how your code is structured.
    – David Reed
    Feb 10 at 15:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.