clear.js 274 B

123456789101112
  1. // Inspired by Google Closure:
  2. // http://closure-library.googlecode.com/svn/docs/
  3. // closure_goog_array_array.js.html#goog.array.clear
  4. 'use strict';
  5. var value = require('../../object/valid-value');
  6. module.exports = function () {
  7. value(this).length = 0;
  8. return this;
  9. };