What is the difference between a fraction and a float?


I understand any fraction to be a quotient of integers which isn’t 0, but after coming across the term "float" in various programming languages (such as JavaScript) I misunderstand why it is even needed and we don’t say a fraction instead.

What is the difference between a fraction and a float?