How to put a value of a var inside an array item?

0

I'm working on Google Charts , but I came across a situation, and I'd like to know if I can do something like this:

var numero = 45;
var data = google.visualization.arrayToDataTable([
    ['Onyx', '<valor da var numero aqui>]
]);
    
asked by anonymous 12.04.2018 / 17:25

1 answer

0

Dude, just pass the variable number inside the vector as Roberto de Campos said, what you have to see is what google.visualization.arrayToDataTable() can receive as a parameter. Type pq has one brackets inside the other in method?

var numero = 45;
var data = ['Onyx', numero];

alert(data);
    
12.04.2018 / 19:58