It’s time you learn Arrow Functions.
<p>If you’ve been coding in JavaScript for more than a day, you’ve probably asked yourself, ‘What on earth is this ‘this’?' Time to make sense of it all with arrow functions.</p>
<p><img alt="" src="https://miro.medium.com/v2/resize:fit:630/1*l3x375kq20gluuKD9Li1iw.jpeg" style="height:420px; width:700px" /></p>
<blockquote>
<p>If you would like to follow along what I’m learning from, I’m using the Mozilla JavaScript Documentation, specifically the <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Introduction" rel="noopener ugc nofollow" target="_blank">JavaScript Guide</a>. Currently we are on the section of <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Functions" rel="noopener ugc nofollow" target="_blank">Functions</a>, subsection Arrow Functions. In these blogs I simply read, type, and try to understand the information presented to me. If I need more information on something, I will ask ChatGPT for assistance, and type down what useful information I have gained from it to also help you, the reader, in a teaching style manor.</p>
</blockquote>
<p>An arrow function expression (also called a fat arrow to distinguish from a hypothetical <code>-></code> syntax in future JavaScript) has a shorter syntax compared to function expressions and does not have its own <code>this</code>, <code>arguments</code>, <code>super</code>, or <code>new.target</code>. Arrow functions are always anonymous*.</p>
<p>Two factors influenced the introduction of arrow functions: shorter functions and non-binding of <code>this</code>.</p>
<p><a href="https://medium.com/@edwardsharples0/its-time-you-learn-arrow-functions-428054bbcf36">Website</a></p>