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 JavaScript Basics (Retired) Creating Reusable Code with Functions Random Number Challenge, Part II Solution

Christopher Mlalazi
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Christopher Mlalazi
Front End Web Development Techdegree Graduate 17,305 Points

Where Do I use Javascript?

This might be a strange question, but in Html and CSS I learnt how to use these two on a text editor and produce a website, but so far at this stage of learning javascript we are being told functions and the quizz challenges, but my question is how and where do I write javascript so that I can see it in action. If it's games where do I write the games, what text editor do I use and how do I publish the games? Maybe I will learn this further as I go along but it is a question that is running in my head right now.

2 Answers

Christopher Mlalazi - JavaScript is used to add interactivity to "static" websites (plain HTML and CSS). You can write JavaScript in a text editor (I recommend Sublime Text 2), just like HTML and CSS, except the file needs to be saved as a .js file and linked to your HTML file(s). You can also play around with JavaScript in the Console of web browsers' developers tools.

JavaScript games are essentially web apps and a tad more complicated. To my knowledge, they don't need to be published anywhere and are played on a browser.

Just stick to the HTML, CSS, and JavaScript courses and it will all be cleared up on how and when to implement JavaScript. Learn the basics of functions, variables, loops, etc., and using them later will be much easier.

Also, if you're really interested in games, Treehouse released a new Game Development course using Unity. Happy Learning!