Skip to content

Instantly share code, notes, and snippets.

View eoo's full-sized avatar

Tarun Garhwal eoo

  • India
View GitHub Profile
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');
/*
Usage: flatten(array)
Parameters: Array of nested arrays of any depth
Output: fallened array with all empth elements removed
*/
function flatten(arr, result = []){
/*
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