Other languages are imported directly and do not need to be exported, so why does es6 have such a thing?

for example, if java, wants to use which class, just import this class directly. There is no need to export in that class

Why does es6 have to export this thing? It feels troublesome and unnecessary.


java A file to introduce a file is to introduce a class
js. A file can have multiple functions. If you do not want to introduce a js file, all the functions of all classes must be exported.
set which things can be exported instead of exporting everything.


java can be imported directly, but if there are requirements for the file name, it should be consistent with the class name. No need to export is not cost-free

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b31114-402f1.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b31114-402f1.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?