main
Last change
on this file was 79a0317, checked in by stefan toskovski <stefantoska84@…>, 4 days ago |
F4 Finalna Verzija
|
-
Property mode
set to
100644
|
File size:
314 bytes
|
Rev | Line | |
---|
[79a0317] | 1 | 'use strict';
|
---|
| 2 | var $ = require('../internals/export');
|
---|
| 3 |
|
---|
| 4 | var min = Math.min;
|
---|
| 5 | var max = Math.max;
|
---|
| 6 |
|
---|
| 7 | // `Math.clamp` method
|
---|
| 8 | // https://rwaldron.github.io/proposal-math-extensions/
|
---|
| 9 | $({ target: 'Math', stat: true, forced: true }, {
|
---|
| 10 | clamp: function clamp(x, lower, upper) {
|
---|
| 11 | return min(upper, max(lower, x));
|
---|
| 12 | }
|
---|
| 13 | });
|
---|
Note:
See
TracBrowser
for help on using the repository browser.