Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript Asynchronous Programming with JavaScript Understanding Promises Perform Cleanup With finally()

Alex England
Alex England
14,602 Points

Shouldnt there be a ; at then end of the promise chain?

I noticed in Guil's code there isn't a semi colon at the end of the catch/finally statements. Should there be?

2 Answers

kevin curtis
kevin curtis
15,287 Points

No, in fact, using es2015 onwards you don't actually need to include a semicolon at the end of any of your lines of code in JavaScript. However there are some guidelines worth observing. Take a look at this article: https://medium.com/@thakkery/a-practical-style-guide-to-semi-colons-in-es6-c4f63d03a904

I think the correct answer is yes, it should, if you are typically ending all your relevant lines with a ;.

But as Kevin said, it's not mandatory. It's more of a stylistic choice I guess.