JavaScript Arrow Functions

ECMAScript 6 introduced some interesting new stuff.  We have already covered let and const, previously.  I figured that it is time to cover arrow functions, now.

See the Pen
Arrow Functions – Part 1
by Joe Steinbring (@steinbring)
on CodePen.

As you can see in the above example, at the very least, this new syntax can shortens your code a bit.  Let’s see what the code looks like when we add a parameter, though.

See the Pen
Arrow Functions – Part 2
by Joe Steinbring (@steinbring)
on CodePen.

Not bad but how can we simplify out function, more?

See the Pen
Arrow Functions – Part 3
by Joe Steinbring (@steinbring)
on CodePen.

As you can see above, with arrow functions, we can simplify our “Hello World” example, quite a bit.

Have any questions, comments, concerns?  Feel free to drop a comment, bellow.

 

[ Cover photo by Nick Fewings on Unsplash ]

Leave a Reply

Your email address will not be published. Required fields are marked *