Welcome aboard! We are happy you are here and wish you good net-raft!
// put into app.js
var http = require('http');
http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/html'});
var myData = []; // create an array
myData.push("nodejs"); // add at the end
myData.unshift("javascript"); // add to the top
res.write('<select>');
for (var i = 0; i < myData.length; i++) {
res.write('<option>' + myData[i] + '</option>'); // retrieve from the array
}
res.write('</select>');
res.end();
}).listen(3000);
console.log("Listening to Port 3000");
// type "node app.js" in command prompt
// then put this url "http://localhost:3000/" into any browser
The most helpful NODEJS solutions