Standard built-ins
Math.ceil()
Smallest integer not less than the input; rounds toward positive infinity. Converts x to Number; BigInt conversion throws TypeError.
Formal Syntax & Structure
javascript syntaxjavascript
Math.ceil(x)Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| x | number | Number input or value coercible to Number. |
Return Value
number
Result of the numerical operation, possibly NaN.
Working Example
Example Snippetjavascript
console.log(Math.ceil(-2.1));