You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
12 lines
400 B
12 lines
400 B
'use strict';
|
|
var $ = require('../internals/export');
|
|
var $clamp = require('../internals/math-clamp');
|
|
var thisNumberValue = require('../internals/this-number-value');
|
|
|
|
// `Number.prototype.clamp` method
|
|
// https://github.com/tc39/proposal-math-clamp
|
|
$({ target: 'Number', proto: true, forced: true }, {
|
|
clamp: function clamp(min, max) {
|
|
return $clamp(thisNumberValue(this), min, max);
|
|
}
|
|
});
|
|
|