JavaScript Function Training

Demonstrating the value of functions by determining the timing of a train wreck

Two trains leaving from different cities head toward each other at different speeds. Train A, traveling 80 kilometers per hour, leaves Philadelphia heading toward New York, 150 kilometers away. At the same time Train B, traveling 120 kph, leaves New York heading toward Philadelphia…