- Skip to main content
- Skip to search
- Skip to select language
- References
Overview / Web Technology
Web technology reference for developers
HTML
Structure of content on the web
CSS
Code used to describe document style
JavaScript
General-purpose scripting language
HTTP
Protocol for transmitting web resources
Web APIs
Interfaces for building web applications
Web Extensions
Developing extensions for web browsers
Web Technology
Web technology reference for developers
- Guides
Overview / MDN Learning Area
Learn web development
MDN Learning Area
Learn web development
HTML
Learn to structure web content with HTML
CSS
Learn to style content using CSS
JavaScript
Learn to run scripts in the browser
Accessibility
Learn to make the web accessible to all
- MDN Plus
Overview
A customized MDN experience
Documentation
Learn how to use MDN Plus
FAQ
Frequently asked questions about MDN Plus
- Already a subscriber?
- Get MDN Plus
- References
- JavaScript
- JavaScript
- Expressions and operators
- Division [/]
Related Topics
- JavaScript
- Tutorials:
- Complete beginners
- JavaScript basics
- JavaScript first steps
- JavaScript building blocks
- Introducing JavaScript objects
- JavaScript Guide
- Introduction
- Grammar and types
- Control flow and error handling
- Loops and iteration
- Functions
- Expressions and operators
- Numbers and dates
- Text formatting
- Regular expressions
- Indexed collections
- Keyed collections
- Working with objects
- Using classes
- Using promises
- Iterators and generators
- Meta programming
- JavaScript modules
- Intermediate
- Client-side JavaScript frameworks
- Client-side web APIs
- Language overview
- JavaScript data structures
- Equality comparisons and sameness
- Closures
- Advanced
- Inheritance and the prototype chain
- Strict mode
- JavaScript typed arrays
- Memory Management
- Concurrency model and Event Loop
- References:
- Built-in objects
- Overview
- AggregateError
- Array
- ArrayBuffer
- AsyncFunction
- AsyncGenerator
- AsyncGeneratorFunction
- Atomics
- BigInt
- BigInt64Array
- BigUint64Array
- Boolean
- DataView
- Date
- decodeURI[]
- decodeURIComponent[]
- encodeURI[]
- encodeURIComponent[]
- Error
- Deprecatedescape[]
- eval[]
- EvalError
- FinalizationRegistry
- Float32Array
- Float64Array
- Function
- Generator
- GeneratorFunction
- globalThis
- Infinity
- Int16Array
- Int32Array
- Int8Array
- Non-standardInternalError
- Intl
- isFinite[]
- isNaN[]
- JSON
- Map
- Math
- NaN
- Number
- Object
- parseFloat[]
- parseInt[]
- Promise
- Proxy
- RangeError
- ReferenceError
- Reflect
- RegExp
- Set
- SharedArrayBuffer
- String
- Symbol
- SyntaxError
- TypedArray
- TypeError
- Uint16Array
- Uint32Array
- Uint8Array
- Uint8ClampedArray
- undefined
- Deprecatedunescape[]
- URIError
- WeakMap
- WeakRef
- WeakSet
- Expressions & operators
- Overview
- Addition [+]
- Addition assignment [+=]
- Assignment [=]
- async function expression
- async function* expression
- await
- Bitwise AND [&]
- Bitwise AND assignment [&=]
- Bitwise NOT [~]
- Bitwise OR [|]
- Bitwise OR assignment [|=]
- Bitwise XOR [^]
- Bitwise XOR assignment [^=]
- class expression
- Comma operator [,]
- Conditional [ternary] operator
- Decrement [--]
- delete operator
- Destructuring assignment
- Division [/]
- Division assignment [/=]
- Equality [==]
- Exponentiation [**]
- Exponentiation assignment [**=]
- Function expression
- function* expression
- Greater than [>]
- Greater than or equal [>=]
- Grouping operator [ ]
- import
- import.meta
- in operator
- Increment [++]
- Inequality [!=]
- instanceof
- Left shift [>]
- Unsigned right shift assignment [>>>=]
- void operator
- yield
- yield*
- Statements & declarations
- Overview
- async function
- async function*
- block
- break
- class
- const
- continue
- debugger
- do...while
- empty
- export
- for
- for await...of
- for...in
- for...of
- function declaration
- function*
- if...else
- import
- label
- let
- return
- switch
- throw
- try...catch
- var
- while
- Deprecatedwith
- Functions
- Overview
- The arguments object
- Arrow function expressions
- Default parameters
- getter
- Method definitions
- Rest parameters
- setter
- Classes
- Overview
- Class static initialization blocks
- constructor
- extends
- Private class features
- Public class fields
- static
- Errors
- Overview
- Warning: -file- is being assigned a //# sourceMappingURL, but already has one
- TypeError: invalid Array.prototype.sort argument
- Warning: 08/09 is not a legal ECMA-262 octal constant
- RangeError: radix must be an integer
- SyntaxError: invalid regular expression flag "x"
- SyntaxError: return not in function
- RangeError: BigInt division by zero
- RangeError: BigInt negative exponent
- TypeError: X.prototype.y called on incompatible type
- ReferenceError: can't access lexical declaration 'X' before initialization
- TypeError: can't assign to property "x" on "y": not an object
- RangeError: x can't be converted to BigInt because it isn't an integer
- TypeError: can't convert BigInt to number
- TypeError: can't convert x to BigInt
- TypeError: can't define property "x": "obj" is not extensible
- TypeError: property "x" is non-configurable and can't be deleted
- TypeError: can't redefine non-configurable property "x"
- SyntaxError: cannot use `??` unparenthesized within `||` and `&&` expressions
- TypeError: cyclic object value
- TypeError: can't access dead object
- SyntaxError: applying the 'delete' operator to an unqualified name is deprecated
- ReferenceError: deprecated caller or arguments usage
- Warning: expression closures are deprecated
- SyntaxError: "0"-prefixed octal literals and octal escape seq. are deprecated
- SyntaxError: Using //@ to indicate sourceURL pragmas is deprecated. Use //# instead
- Warning: String.x is deprecated; use String.prototype.x instead
- Warning: Date.prototype.toLocaleFormat is deprecated
- SyntaxError: test for equality [==] mistyped as assignment [=]?
- TypeError: setting getter-only property "x"
- SyntaxError: Unexpected '#' used outside of class body
- SyntaxError: identifier starts immediately after numeric literal
- SyntaxError: illegal character
- TypeError: cannot use 'in' operator to search for 'x' in 'y'
- RangeError: invalid array length
- SyntaxError: invalid assignment left-hand side
- SyntaxError: invalid BigInt syntax
- TypeError: invalid assignment to const "x"
- RangeError: invalid date
- SyntaxError: for-in loop head declarations may not have initializers
- SyntaxError: a declaration in the head of a for-of loop can't have an initializer
- TypeError: invalid 'instanceof' operand 'x'
- TypeError: 'x' is not iterable
- SyntaxError: JSON.parse: bad parsing
- SyntaxError: Malformed formal parameter
- URIError: malformed URI sequence
- SyntaxError: missing ] after element list
- SyntaxError: missing : after property id
- SyntaxError: missing } after function body
- SyntaxError: missing } after property list
- SyntaxError: missing formal parameter
- SyntaxError: missing = in const declaration
- SyntaxError: missing name after . operator
- SyntaxError: missing ] after argument list
- SyntaxError: missing ] after condition
- SyntaxError: missing ; before statement
- TypeError: More arguments needed
- RangeError: repeat count must be non-negative
- TypeError: "x" is not a non-null object
- TypeError: "x" has no properties
- SyntaxError: missing variable name
- TypeError: can't delete non-configurable array element
- RangeError: argument is not a valid code point
- TypeError: "x" is not a constructor
- TypeError: "x" is not a function
- ReferenceError: "x" is not defined
- RangeError: precision is out of range
- Error: Permission denied to access property "x"
- TypeError: "x" is read-only
- SyntaxError: redeclaration of formal parameter "x"
- TypeError: Reduce of empty array with no initial value
- SyntaxError: "x" is a reserved identifier
- RangeError: repeat count must be less than infinity
- Warning: unreachable code after return statement
- SyntaxError: "use strict" not allowed in function with non-simple parameters
- InternalError: too much recursion
- ReferenceError: assignment to undeclared variable "x"
- ReferenceError: reference to undefined property "x"
- SyntaxError: Unexpected token
- TypeError: "x" is [not] "y"
- SyntaxError: function statement requires a name
- SyntaxError: unparenthesized unary expression can't appear on the left-hand side of '**'
- SyntaxError: unterminated string literal
- Misc
- JavaScript technologies overview
- Lexical grammar
- JavaScript data structures
- Enumerability and ownership of properties
- Iteration protocols
- Strict mode
- Transitioning to strict mode
- Template literals
- Trailing commas
- Deprecated features
The division operator [/
] produces the quotient of its operands where the left operand is the dividend and the right operand is the divisor.
Try it
Syntax
Examples
Basic division
1 / 2 // 0.5
Math.floor[3 / 2] // 1
1.0 / 2.0 // 0.5
Division by zero
2.0 / 0 // Infinity
2.0 / 0.0 // Infinity, because 0.0 === 0
2.0 / -0.0 // -Infinity
Specifications
ECMAScript Language Specification # sec-multiplicative-operators |
Browser compatibility
BCD tables only load in the browser
See also
- Addition operator
- Subtraction operator
- Multiplication operator
- Remainder operator
- Exponentiation operator
- Increment operator
- Decrement operator
- Unary negation operator
- Unary plus operator