Each capacitor and coil has a frequency-dependent reactive resistor (reactance).
Conversely, the corresponding component can be calculated from any reactive resistor (reactance) at a given frequency.
The first javascript calculates from an existing component at a certain frequency of the reactive resistance (reactance).
The second javascript calcutates the component from an existing reactive resistor (reactance) at a certain frequency.