Express

 20 Minutes
 10 Questions


This test is designed to assess a student's knowledge of technology, Express, and the basics. It will cover topics such as computer hardware and software, web development tools, and basic programming concepts. The test will also include questions about Express, including its features and how to use it. Finally, the test will assess the student's understanding of basic concepts related to technology such as data structures and algorithms.


Example Question:

Multiple-Choice
Consider the below Node.js files, what will be the result of running the following URL localhost:1333/table ?
//main.js
var express = require('express');
var ejs = require('ejs');
var app = express();
app.set('views', __dirname + '/views');
app.set('view engine', 'ejs');
app.get('/table', function(req, res, next) {
var context = {dataArray: ['aaa', 'bbb', 'bbb']};
context.dataArray.push(4);
res.render('timesheet', context);
});
app.listen(1333, function(){
console.log('Go...');
});
// views/test.ejs
<body>
<table>
<tbody>
<% dataArray.forEach(function(data, index) { %>
<tr>
<td> <%= data %> </td>
</tr>
<% }) %>
</tbody>
</table>
</body>