adds first and rest

This commit is contained in:
Quentin Leonetti
2019-07-13 18:18:35 +02:00
parent 805e9ccb28
commit 5de7d7fdc4
2 changed files with 14 additions and 0 deletions

View File

@@ -28,10 +28,19 @@ function Library (ronin) {
console.log(...args)
}
// Arrays
this.map = (fn, arr) => {
return arr.map(fn)
}
this.first = (arr) => {
return arr[0]
}
this.rest = ([_, ...arr]) => {
return arr
}
// Rects
this.pos = (x, y, t = 'pos') => {