a fraction calculator in js