JavaScript prompt calculator