Hello
I'm studying Javascript and I'm having a question. I come from a world called Java and there exists the modifiers of access private, protected, public and even variable without declaration of modifier; and with that I'm a little lost in javascript.
Is it possible to display the file1.js variable through a function, for example in file2.js? Usually in java we leave the variable public or we use getters and setters for such action.
I had this doubt because in an online course I came in the scope part and only addresses the scope in relation to the file itself, but the guy who teaches recommends being careful with scopes because a variable can be accessible anywhere else in the project, but does not elaborate.
I wanted to know how this question works in javascript, as my interest is to learn how to work with JS in the backend with NodeJs.
Some material that you recommend that I read? Or a lecture or video lesson that talks about?
Thank you in advance!