Why is the number not growing as I expected, but increasing by 2 instead of 1?
<p>I have the following code in React: </p>
<pre class="brush:php;toolbar:false;">let guest = 0;
functionCup() {
guest = guest 1;
return <h2>{guest}’s teacup</h2>;
}
export default function TeaSet() {
return (
<>
<Cup />
<Cup />
<Cup />
</>
);
}</pre>
<p>My desired result is:</p>
<pre class="lang-none prettyprint-override"><code>The first guest’s teacup
Tea cup for the 2nd guest
The third guest’s tea cup
</code></pre>
<p>However, the actual result returned is: </p>
<pre class="brush:php;toolbar:false;">The second guest’s teacup,
The fourth guest’s tea cup,
The 6th guest’s teacup</pre>
<p>Why is the increment of <code>guest</code> 2 instead of 1 as I specified? </p>