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![](https://ecs-static.teamtreehouse.com/assets/views/marketing/shared/community-banner-white-47072046c51352fe6a69f5e691ff5700b28bb11d45197d7bdf066d9ea3f72d0c.webp)
![Jenniffer Hernandez](https://secure.gravatar.com/avatar/d77fd138fe9807305581ff5bee4bac55?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Jenniffer Hernandez
Full Stack JavaScript Techdegree Student 11,662 PointsHello, just wondering if there is a missing semi colon after this.books.push(book);
Hello, just wondering if there is a missing semi colon after this.books.push(book);
![Nick Huemmer](https://secure.gravatar.com/avatar/7014e6a1ce0961b47e7bcda92e367e78?s=60&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Nick Huemmer
Front End Web Development Techdegree Graduate 26,840 PointsIt's interesting that addPatron()
uses a semicolon, while addBook()
doesn't. It can be confusing for those of us new to JavaScript.
2 Answers
![Victor Mercier](https://secure.gravatar.com/avatar/c897360e3f0847d6e47bea90c7205350?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Victor Mercier
14,667 PointsYou will not get any error if you don’t put the semicolon.
![Clinton Hays](https://uploads.teamtreehouse.com/production/profile-photos/11546749/micro_profile-pic-square.jpg)
Clinton Hays
Front End Web Development Techdegree Graduate 18,156 PointsYeah, I think this was probably just a typo. Typically, you'll want to end return statements with a semicolon. Often, developers use an extension like Prettier to catch those things. But, Tammi Carter is correct, in this instance it won't affect behavior, but in other cases it might...so it's better to err on the side of caution.
Tammi Carter
5,360 PointsTammi Carter
5,360 PointsGood Day Jenniffer, The Semi Colon whether used or not will not really effect the way your code runs, in "MOST" instances, however in my brief experience with coding , I personally find that its easier to read my own code , to better understand where my code breaks are. Some say "Yes Use it" others say "No It's not necessary", I say if your code is accomplishing what you set it out to accomplish use the method that best fits your coding style. Here is some information I found to be a "good 11 min. listen" on the Semi Colon subject topic. Happy Coding Ms. Hernandez. :-)
ASI Guide - How to Use Semicolons in JavaScript https://youtu.be/DiPmHTYWP78