Can anyone show me an iterative solution for the following problem? I solved it recursively but struggled with an iterative solution. (Facebook Technical Interv
Works, but not recommended:
var flatten = function(input) { return eval("[" + JSON.stringify(input). replace(/\[/g,"").replace(/\]/g,"") + "]"); }