javascript – react natively: Is it possible to replace & # 39; array[0]& # 39; with & # 39; This & # 39;

I'm trying to console.log an array. Instead of the hard coding matrix number, can I use This status

For example, this would be the usual way to console.log an array with a number:

console.log (array[2], & # 39; Show matrix number 2 & # 39;)

Is there any way I can replace training[2]with this.note.number ?

I tried this but it will not work.

this.state = {
Number 2 & # 39;
console.log (array.this.state.number, & # 39; show array with state & # 39;)