main
Last change
on this file since d565449 was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago |
Update repo after prototype presentation
|
-
Property mode
set to
100644
|
File size:
458 bytes
|
Line | |
---|
1 | 'use strict';
|
---|
2 |
|
---|
3 | var $TypeError = require('es-errors/type');
|
---|
4 |
|
---|
5 | var NumberAdd = require('./add');
|
---|
6 | var NumberUnaryMinus = require('./unaryMinus');
|
---|
7 |
|
---|
8 | // https://262.ecma-international.org/12.0/#sec-numeric-types-number-subtract
|
---|
9 |
|
---|
10 | module.exports = function NumberSubtract(x, y) {
|
---|
11 | if (typeof x !== 'number' || typeof y !== 'number') {
|
---|
12 | throw new $TypeError('Assertion failed: `x` and `y` arguments must be Numbers');
|
---|
13 | }
|
---|
14 | return NumberAdd(x, NumberUnaryMinus(y));
|
---|
15 | };
|
---|
Note:
See
TracBrowser
for help on using the repository browser.