Ділення (/)
Оператор ділення (/
) повертає частку своїх операндів, де лівий операнд є діленим, а правий операнд є дільником.
The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request.
Синтаксис
Оператор: x / y
Приклади
Базове ділення
1 / 2 // 0.5
Math.floor(3 / 2) // 1
1.0 / 2.0 // 0.5
Ділення на нуль
2.0 / 0 // Infinity
2.0 / 0.0 // Infinity, тому що 0.0 === 0
2.0 / -0.0 // -Infinity
Специфікації
Сумісність з веб-переглядачами
BCD tables only load in the browser