The dominant scripting language of the web is JavaScript. This should not be a controversial statement. Yet, among some Flash Devs, it might be. I still enjoy ActionScript, but getting more into the front end HTML/CSS/JS stack has been a lot of fun.
Like other developers diving into JavaScript, my first instinct was to do things the way I would in the language I know best, in my case AS3. This works for simple stuff, as the two languages are syntactically alike. However, for more complex development, big differences emerge. There’s been some smack talk toward the JavaScript language coming from the Flash community, ripping on it for being more like older, primitive versions of ActionScript. I admit that I felt this way at first, but that was before I understood what JS was all about. Ultimately, when compared to AS3, it isn’t better or worse, just different.
I don’t have a programming background (was an art major), so it took awhile to wrap my head around OOP and the various popular design patterns. Similarly, it took time to appreciate the concepts that are specific to JavaScript. A huge help in this were Douglas Crockford’s JavaScript talks. If you want to get into JavaScript, take the time to watch those. Also, I think it almost goes without saying that StackOverflow is a tremendous resource for any developer using any programming language, and JS is no exception.

In ActionScript, you use strictly-typed class structure when building an app. That is not the case with JavaScript. It may be confusing at first when you see JS code that seems to have a class structure, but in reality, there is no class type in JavaScript. It is all about objects and functions. Well, functions are actually objects too, so really, I guess it is all about objects.
The lack of strict typing may seem like a drawback, but it isn’t really, if you are doing it right. In Flash, anonymous functions are bad, but in JS they are not just good, they are an essential and powerful feature. One example of this is the module pattern. Understanding this pattern and what it was for, made me appreciate JavaScript as a whole.
There are lots of great explanations of the module pattern out there. Here is an example of what it looks like:
var App = (function() {
var privateVar = "I am a private var.";
function privateMethod() {
// do something privately
}
var App = {
publicVar : "I am a public var.",
init : function() {
alert("Hello World!");
},
saySomethingPrivate : function() {
alert(privateVar);
}
};
return App;
}());
If you are primarily a Flasher who has not done much with JS, then that code will probably look all kinds of crazy. Well, that was me a few months ago. Explaining this common, well-understood JS code block and why it is cool to the me from last year would be a difficult task. It was fun figuring it out though.