Simulator in computing salary (javascript)