.
This commit is contained in:
2
cat.sh
2
cat.sh
@@ -1,3 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
cat dll.js pt.js grid.js binheap.js graph.js proto.js utils.js > out.js
|
||||
cat dll.js pt.js grid.js binheap.js graph.js proto.js utils.js test.js > out.js
|
||||
|
||||
10
out.js
10
out.js
@@ -234,6 +234,11 @@ class Point {
|
||||
|
||||
Pt = Point
|
||||
|
||||
function P(...args) {
|
||||
return new Point(...args)
|
||||
}
|
||||
|
||||
|
||||
class Grid {
|
||||
constructor(w, h, fill = 0) {
|
||||
this.width = w
|
||||
@@ -653,8 +658,8 @@ Object.defineProperties(Array.prototype, {
|
||||
}
|
||||
},
|
||||
sum: {
|
||||
value: function() {
|
||||
return this.reduce((a, b) => a + b)
|
||||
value: function(val) {
|
||||
return this.reduce((a, b) => a + b, val)
|
||||
}
|
||||
},
|
||||
flatDeep: {
|
||||
@@ -793,3 +798,4 @@ utils = {
|
||||
createGridArray: (w, h, fill = undefined) => Array(h).fill().map(() => Array(w).fill(fill))
|
||||
}
|
||||
|
||||
console.log(P(0, 0))
|
||||
|
||||
4
proto.js
4
proto.js
@@ -36,8 +36,8 @@ Object.defineProperties(Array.prototype, {
|
||||
}
|
||||
},
|
||||
sum: {
|
||||
value: function() {
|
||||
return this.reduce((a, b) => a + b)
|
||||
value: function(val) {
|
||||
return this.reduce((a, b) => a + b, val)
|
||||
}
|
||||
},
|
||||
flatDeep: {
|
||||
|
||||
5
pt.js
5
pt.js
@@ -62,3 +62,8 @@ class Point {
|
||||
|
||||
Pt = Point
|
||||
|
||||
function P(...args) {
|
||||
return new Point(...args)
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user