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 tips and tricks

Hello!

Before I started here I knew the basics of HTML and CSS. I decided to try to learn Javascript because I heard it was great with the functionality of a website.

However Javascript blew me away of how complex the syntax was from HTML and CSS. after trying for months i couldn't figure out how to program this code confidently.

I was thinking of trying to learn javascript here on treehouse but before I do, I wanted to ask people who are good at Javascript if they can give me any pointers,

Any help will be appreciated!

1 Answer

Two things. First, as you learn JavaScript, throw away everything you've learned about HTML and CSS and restart from scratch; pretend it never existed.

HTML and CSS are markup languages; their design and intent is to present information. JavaScript is a programming language, and it has a completely different purpose. Its intent is to actually do things with the information: create it, find it, update it, delete it.

Most of the languages taught here on Treehouse are programming languages of one kind or another. PHP, Python, Ruby, Java, Swift, and Objective C are all programming languages. Their purpose is to manipulate data. HTML and CSS only present the data.

Second, truly grasping how objects and functions work is 90% of JavaScript. JavaScript is a weird little language with a weird implementation of functions and objects, but once you understand them, the whole system is genius, though still a little weird.

If you ever feel depressed by how confusing learning your first programming language is, you're far from the first. It's a huge jump to go from HTML and CSS to JavaScript and PHP. The good news is that 90% of the concepts you will learn in JavaScript will translate over to other programming languages, so you'll only have to go through the process once.

Also, we'll be here to help you the whole way. Don't be afraid to ask more questions if you get stuck on something. :)

Hope this helps!

An addendum: Don't learn JavaScript with jQuery. I did that, and it really screwed me up. Learn JavaScript on its own, the hard way, and then add jQuery to it once you've mastered objects and functions.

(jQuery is a library that makes a lot of common tasks in JavaScript way easier.)

Thanks that makes everything easier.