ght"></span><code class="language-javascript">let nc = NATS.connect({
    maxReconnectAttempts: 10,
    servers: [&#34;nats://demo.nats.io:4222&#34;]
});

nc.on(&#39;reconnect&#39;, (c) =&gt; {
    console.log(&#39;reconnected&#39;);
});
</code></pre>
	</div>
	
	<div class="tab__content">
	<pre id="reconnect_event_py_content"><a class="toolbar-icons pull-right" target="_blank" href="https://github.com/nats-io/asyncio-nats-examples/blob/master/reconnect_event.py#L6-25"><i class="mdi mdi-github-circle" title=