source:
frontend/node_modules/es-abstract/2024/abs.js
| Last change on this file was 9af201e, checked in by , 13 days ago | |
|---|---|
|
|
| File size: 211 bytes | |
| Line | |
|---|---|
| 1 | 'use strict'; |
| 2 | |
| 3 | var $abs = require('math-intrinsics/abs'); |
| 4 | |
| 5 | // https://262.ecma-international.org/11.0/#eqn-abs |
| 6 | |
| 7 | module.exports = function abs(x) { |
| 8 | return typeof x === 'bigint' ? (x >= 0 ? x : -x) : $abs(x); |
| 9 | }; |
Note:
See TracBrowser
for help on using the repository browser.
