Two Sum Algorithm Javascript Foreach Continue