10 examples of 'typescript clear array' in JavaScript

Every line of 'typescript clear array' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your JavaScript code is secure.

All examples are scanned by Snyk Code

By copying the Snyk Code Snippets you agree to
this disclaimer
535Array.prototype.clear = function Array$clear() {
536 this.length = 0;
537}
Important

Use secure code every time

Secure your code as it's written. Use Snyk Code to scan source code in minutes – no build needed – and fix issues immediately. Enable Snyk Code

37clear() {
38
39 Array.prototype.splice.call(this, 0, Infinity);
40
41 this.content.innerHTML = '';
42
43 return this;
44}
54clear() {
55 this._head = null;
56 this._last = null;
57 this._length = 0;
58 return this;
59}
24var clearer = function clearer(_clearer, array) {
25 return function (id) {
26 if (this[array]) {
27 var index = this[array].indexOf(id);
28
29 if (index !== -1) {
30 this[array].splice(index, 1);
31 }
32 }
33
34 _clearer(id);
35 };
36};
77ScreenBuffer.prototype.clear = function clear()
78{
79 //this.buffer.fill( 0 ) ; return this ;
80
81 var i , length = this.width * this.height ;
82
83 for ( i = 0 ; i < length ; i ++ )
84 {
85 CLEAR_BUFFER.copy( this.buffer , i * ITEM_SIZE ) ;
86 }
87
88 return this ;
89} ;
4module.exports = function clear() {
5 global.taskList = {};
6};
70clear(): Set<V> {
71 this.data = [];
72 return this;
73}
43BufferList.prototype.clear = function clear() {
44 this.head = this.tail = null;
45 this.length = 0;
46};
663Batch.prototype.clear = function clear() {
664 assert(this.tree, 'Already written.');
665 this.ops.length = 0;
666 return this;
667};
725Graphics.prototype.clear = function clear() {
726 if (this.lineWidth || this.filling || this.graphicsData.length > 0) {
727 this.lineWidth = 0;
728 this.filling = false;
729
730 this.boundsDirty = -1;
731 this.dirty++;
732 this.clearDirty++;
733 this.graphicsData.length = 0;
734 }
735
736 this.currentPath = null;
737 this._spriteRect = null;
738
739 return this;
740};

Related snippets