We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a8b39de commit 3ae4c67Copy full SHA for 3ae4c67
script/algorithms.js
@@ -1,5 +1,16 @@
1
class Frame {
2
- Frame() {}
+ constructor(e, h) {
3
+ this.elements = [];
4
+ this.highlights = [];
5
+
6
+ if (e != undefined && e.length) {
7
+ this.elements = e;
8
+ }
9
10
+ if (h != undefined && h.length) {
11
+ this.highlights = h;
12
13
14
15
addHighlights(highlights) {
16
for (const e of highlights) {
@@ -17,13 +28,12 @@ class Frame {
17
28
this.highlights.length = 0;
18
29
this.elements.length = 0;
19
30
}
20
-
21
- elements = Array();
22
- highlights = Array();
23
31
24
32
25
33
class Animation {
26
- Animation() {}
34
+ constructor() {
35
+ this.frames = [];
36
27
37
38
addFrame(frame) {
39
// Only store a copy
0 commit comments