First of all, I am a .Net developer and I don't have much knowledge about JavaScript.
I have given to build a system using JavaScript which is working 100% offline. I have a big data set like below as CSV file.
+------+---------+----+----+----+----+-------+----------+
| Year | Subject | A | B | C | F | Total | PassRate |
+------+---------+----+----+----+----+-------+----------+
| 2015 | Maths | 12 | 20 | 10 | 5 | 47 | 80 |
| 2015 | Sinhala | 18 | 14 | 5 | 10 | 47 | 75 |
| 2016 | Maths | 25 | 15 | 4 | 8 | 52 | 25 |
| 2016 | Sinhala | 20 | 12 | 2 | 18 | 52 | 60 |
+------+---------+----+----+----+----+-------+----------+
This is just a sample, there are around 50 rows.
I tried to read CSV and tried json,xml files, But I didn't have a success because of cross origin policy
So I thought to save all these data in Multi Dimension array or similar thing. I read How can I create a two dimensional array in JavaScript? but no luck.
So, how can I save all these data to JavaScript variable?
Please note that I have to do lot of calculations (eg: total pass rate of each year) from above table, so I need to access any value easily.
So how can I save all these data to array or similar one?
Note : I am not asking that how to convert CSV to JavaScript variable.I am just asking that how can I save these type of lot of data as JS varible array or similar which allow to do calculation easily.