Two Sum Algorithm Javascript Foreach Break