It seems cleaner to have this code within Planet.js:
Planet.EARTH = new Planet( .... );
and there would be no need for Planets.js.
Additionally, it seems like comparisons are being done with strings for planet names. It seems much cleaner to only do comparisons with Planet objects themselves (e.g. GravitySliderWithListNode.js would have planetProperty be a Property. instead).
Is there a reason why string literals are needed instead of comparing objects?
It seems cleaner to have this code within Planet.js:
and there would be no need for Planets.js.
Additionally, it seems like comparisons are being done with strings for planet names. It seems much cleaner to only do comparisons with Planet objects themselves (e.g. GravitySliderWithListNode.js would have planetProperty be a Property. instead).
Is there a reason why string literals are needed instead of comparing objects?