valeurs_d = "";
for (var i = 0; i < keys.length -1 ; i++)
valeurs_d += + event[keys[i]] + ", ";
var str5 = ",";
var str6 = str5.concat(valeurs_d);
var valeurs = str6.substring (0, str6.length - 2);
console.log(valeurs);
I am working with a JSON document structured like this:
{
"temperature" : 12.45,
"lala" : 45.75,
"humidite" : 45.78,
"toto" : "gvvgvh",
"topic" : "sk1_001/data"
}
However, the issue arises when attempting to retrieve the values as I get: 12.45, 45.75, 45.78, NaN!
Is there a way to retrieve my string instead of NaN?
On another note, does typeof in Javascript return number or string? I want to specify varchar for strings and double for numbers.
This is essential for updating my Apache Cassandra database using node.js.
How can I achieve returning varchar and double accurately?