+-------+---------+----------+---------------+-------------+-----+
| serial| amount | NameOfMyFriends |
+-------+---------+----------+---------------+-------------+-----+
| 1 | 1500.00 | FOOBAR1, FOOBAR2, FOOBAR3, FOOBAR4, FOOBAR5, |
| 2 | 2000.00 | FOOBAR1, FOOBAR3, FOOBAR4, FOOBAR5, |
| 3 | 300.00 | FOOBAR1, FOOBAR2, |
| 4 | 600.00 | FOOBAR2, FOOBAR4, |
| 5 | 900.00 | FOOBAR4, FOOBAR5, |
| 6 | 800.00 | FOOBAR2, FOOBAR5, |
| 7 | 600.00 | FOOBAR1, FOOBAR3, |
+-------+---------+----------+---------------+-------------+-----+
我需要找到每个人的分享是这样的:
- FooBar1 的份额:300 + 500 + 150 + 300 ===> 1250
- FooBar2 的份额:300 + 500 + 150 + 300 + 400 ===> 1650
- FooBar3 的份额:300 + 500 + 300 ===> 800
- FooBar4 的份额:300 + 500 + 300 + 450 + ===> 1550
- FooBar5 的份额:300 + 500 + 450 + 400 ===> 1650
使用 JavaScript 如何在不使用任何 JavaScript 库的情况下提取这样的数据?