This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var express = require('express'); | |
var app = express(); | |
app.set('view engine', 'ejs'); | |
var bodyParser = require('body-parser'); | |
app.use(bodyParser.urlencoded({extended:true})); | |
var Person = require('./Person.js'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Usage: flatten(array) | |
Parameters: Array of nested arrays of any depth | |
Output: fallened array with all empth elements removed | |
*/ | |
function flatten(arr, result = []){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Usage: movie_search(movie_list, genre, top) | |
Parameters: movie_list: the list containing movie objects | |
genre(optional, default = "Action"): the genre for which you want to search | |
top (optional, default = 3): the number of top results to show |