Node.js + express is under development.
The data type I want to use in javascript is
var word_array = [
{text: "Lo", age: 15},
{text: "Ip", age: 9},
{text: "Do", age: 6},
{text: "Si", age: 7},
{text: "Am", age: 5}
];
This is.
Therefore, the result variable data selected by the server stage are as follows
var word_array = new Array();
for (var i=0; i<result.length; i++) {
word_array.push(
{
text: result[i].name,
age: result[i].age
}
);
}
I put it in and passed it to ejs and sprayed it on the console.
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
It comes out together...
How to store data on type I want?
json string ejs express node.js
Check the output by changing it to a string.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify
console.log(JSON.stringify(tmp));
572 rails db:create error: Could not find mysql2-0.5.4 in any of the sources
611 GDB gets version error when attempting to debug with the Presense SDK (IDE)
915 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
574 Who developed the "avformat-59.dll" that comes with FFmpeg?
© 2024 OneMinuteCode. All rights reserved.