回答編集履歴
2
まあ、いらないか。
test
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
```js
|
4
4
|
let result = "";
|
5
|
-
[...sample[0]
|
5
|
+
[...sample[0]].every((...[, i]) => sample.every(x => sample[0][i] === x[i]) ? result += sample[0][i] : false)
|
6
6
|
console.log(
|
7
7
|
result
|
8
8
|
)
|
1
修正
test
CHANGED
@@ -1 +1,10 @@
|
|
1
|
-
|
1
|
+
~~[...sample[0].slice(0, Math.min(...sample.map(x => x.length)))].filter((...[, i]) => sample.every(x => sample[0][i] === x[i])).join('')~~
|
2
|
+
|
3
|
+
```js
|
4
|
+
let result = "";
|
5
|
+
[...sample[0].slice(0, Math.min(...sample.map(x => x.length)))].every((...[, i]) => sample.every(x => sample[0][i] === x[i]) ? result += sample[0][i] : false)
|
6
|
+
console.log(
|
7
|
+
result
|
8
|
+
)
|
9
|
+
// "my_name_is_"
|
10
|
+
```
|