I have a table that looks like this:
+-------+-------+-------+-------+-------+
| Week1 | Week2 | Week3 | Week4 | Week5 |
+-------+-------+-------+-------+-------+
| AAAAA | BBBBB | CCCCC | DDDDD | EEEEE |
+-------+-------+-------+-------+-------+
I would like to write a function that:
For example: function(1,2) means: copy Week 1 value to Week 2
+-------+-------+-------+-------+-------+
| Week1 | Week2 | Week3 | Week4 | Week5 |
+-------+-------+-------+-------+-------+
| AAAAA | AAAAA | CCCCC | DDDDD | EEEEE |
+-------+-------+-------+-------+-------+
For another example:
function(1,[2,3]) means: copy Week 1 value to Week 2 and Week 3
+-------+-------+-------+-------+-------+
| Week1 | Week2 | Week3 | Week4 | Week5 |
+-------+-------+-------+-------+-------+
| AAAAA | AAAAA | AAAAA | DDDDD | EEEEE |
+-------+-------+-------+-------+-------+
For another example: function(4,[2,3,5]) means: copy Week 4 value to Week 2, Week 3, and Week 5
+-------+-------+-------+-------+-------+
| Week1 | Week2 | Week3 | Week4 | Week5 |
+-------+-------+-------+-------+-------+
| AAAAA | DDDDD | DDDDD | DDDDD | DDDDD |
+-------+-------+-------+-------+-------+
For another example: function(2,[1,3,5]) means: copy Week 2 value to Week 1, Week 3, and Week 5
+-------+-------+-------+-------+-------+
| Week1 | Week2 | Week3 | Week4 | Week5 |
+-------+-------+-------+-------+-------+
| BBBBB | BBBBB | BBBBB | DDDDD | BBBBB |
+-------+-------+-------+-------+-------+
There could be only 1 reference column, but there could be multiple impacted columns.
I am very new to TypeScript and can't wrap my head around on how to do this in TypeScript.
I am not sure if thinking this way makes sense:
Much appreciation for any help!