There is a multidimensional array:
var arr = [ [1,2,3], [4,5,6], [7,8,9] ]; how to navigate it?
There is a text: Yes, I have 5.
When the number 5 is in the text, I have to replace it with 2.
When the number 7 is in the text, I have to replace it with 4.
And so on. (example at least on the movement in up, then I will understand)
You can omit everything except the function that takes the value of the variable and on its basis selects the desired value.
I would be very grateful for the help.