回答編集履歴
2
chousei
answer
CHANGED
@@ -7,4 +7,15 @@
|
|
7
7
|
console.log(result);
|
8
8
|
})();
|
9
9
|
```
|
10
|
-
微調整
|
10
|
+
微調整
|
11
|
+
|
12
|
+
Lhankor_Mhyさんのご指摘をうけて
|
13
|
+
```javascript
|
14
|
+
<script type="module">
|
15
|
+
let result=[];
|
16
|
+
const getCSV=()=>fetch('sample.csv').then(res=>res.text()).then(csvArray);
|
17
|
+
const csvArray=str=>str.split("\r\n").map(x=>x.split(","));
|
18
|
+
result=await getCSV();
|
19
|
+
console.log(result);
|
20
|
+
</script>
|
21
|
+
```
|
1
微調整
answer
CHANGED
@@ -1,9 +1,10 @@
|
|
1
1
|
```javascript
|
2
|
-
const getCSV=
|
2
|
+
const getCSV=()=>fetch('sample.csv').then(res=>res.text()).then(csvArray);
|
3
|
-
const csvArray=
|
3
|
+
const csvArray=str=>str.split("\r\n").map(x=>x.split(","));
|
4
4
|
|
5
5
|
(async ()=>{
|
6
6
|
const result=await getCSV();
|
7
7
|
console.log(result);
|
8
8
|
})();
|
9
|
-
```
|
9
|
+
```
|
10
|
+
微調整
|