to find the intersection of two arrays using only string functions. Given var x = [1,2,3,4,5,6,7,8]; and var y = [1,2,3,3,3,5]; Your function should return ["1" , "2" , "3" , "5"] Rules Use only in-built javascript string functions No loops / array iterator functions (e.g. filter, map, forEach, each, some e.t.c.) No external / 3rd party libraries
(and manager) that helps scaffold project route handlers and controllers. (The current build is suited only for Node JS projects using the Express framework)
(and manager) that helps scaffold project route handlers and controllers. (The current build is suited only for Node JS projects using the Express framework) (While the current build only supports Njs projects using the Express framework, it can be modified for use with other languages (and frameworks) that follow the MVC pattern.)
Directure –This module (stand-alone) handles all file system related operations Grammar Parser – Reads the appitecture.apt file, parses our the route paths, handlers, middlewares, controller functions Generator –Takes parsed information from the Grammar Parser and uses it to generate files ( and directories)
apt file define the configurations to be used by the parser The remaining lines define the application routes, controllers (if any) and HTTP methods.
var xstr = x.toString(); var ystr = y.toString(); var xstrr = "\\b" + xstr.replace(/,/g,'\\b|\\b') + "\\b"; var intersection = ystr.match(new RegExp(xstrr,'g')); var ms = {}; var inter =[]; var intersection_cleaned = intersection.toString().replace(/\b\d+\b/g,function(m,i){ if(!ms[m]) inter.push(m); ms[m] = 1; return m; }); console.log(inter );