Code
Hub
Workspaces
Connect
Indexed graphs
Engine
MCP
copy
Index your code
hub
/
github.com/processing/p5.js
/ shrinkToDimension
Function
shrinkToDimension
src/math/p5.Vector.js:26–30 ·
view source on GitHub ↗
(arr, dim)
Source
from the content-addressed store, hash-verified
24
* In-place, shrinks an array to a dimension.
25
*/
26
const
shrinkToDimension =
function
(arr, dim) {
27
while
(arr.length > dim) {
28
arr.pop();
29
}
30
}
31
32
33
class
Vector {
Callers
5
add
Method · 0.85
rem
Method · 0.85
sub
Method · 0.85
mult
Method · 0.85
div
Method · 0.85
Calls
1
pop
Method · 0.45
Tested by
no test coverage detected