summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Cully <bjc@kublai.com>2021-02-19 13:35:33 -0500
committerBrian Cully <bjc@kublai.com>2021-02-19 13:35:33 -0500
commita5629c55b5575a590f9e8c7884c3bd532c3ed063 (patch)
tree9ba9516071c6b5d1b8da3658b9d27e175d470866
parented96e5c2964d93bd5b43f85577ef4ab7c217fa2d (diff)
downloadmolsim2-a5629c55b5575a590f9e8c7884c3bd532c3ed063.tar.gz
molsim2-a5629c55b5575a590f9e8c7884c3bd532c3ed063.zip
Remove use of flatMap for old Safari.
-rw-r--r--genome.mjs6
1 files changed, 4 insertions, 2 deletions
diff --git a/genome.mjs b/genome.mjs
index 432a59b..7550cf6 100644
--- a/genome.mjs
+++ b/genome.mjs
@@ -38,7 +38,9 @@ class Genome {
}
get nucleotides() {
- return this.codons.flatMap(c => c.bases)
+ return this.codons.reduce((acc, c) => {
+ return acc.concat(c.bases)
+ }, [])
}
get onNucleotideSelectionChanged() {
@@ -63,7 +65,7 @@ class Genome {
}
clone() {
- return new Genome(this.codons.flatMap(c => c.bases.map(b => b.value)))
+ return new Genome(this.nucleotides.map(n => n.value))
}
get selectedNucleotide() {