Obtenha o índice depois de pressionar o valor na matriz em JS

var testRowIndex = gridData.push(TestRow) - 1;
Gentle Gnat