Section Introduction Transcripts

Introduction to JavaScriptHi. I'm Liam McLennan. Welcome to an Introduction to JavaScript. In this course I will show you that JavaScript can be a beautiful little language despite what you may have heard. I'll focus on JavaScript the programming language rather than its uses for scripting web pages and AJAX. My favorite thing about JavaScript is its size. It's very small and has a very low concept count. There are a few tricky areas where it behaves differently to other languages you might be more familiar with, but once you understand the differences then JavaScript becomes a comfortable and productive programming tool. Step one will be to take a look at what JavaScript is. Obviously that's something that's important to cover in this course. Once we understand that we'll move onto discussion of why JavaScript is important and why I think every web developer should have a good understanding of the fundamentals of the JavaScript language. After that we'll take a look at the history of JavaScript and try to get an understanding of how JavaScript began, how it got to where it is at the moment, and from there also some consideration of what the future might hold and how JavaScript is evolving now. Next up we will move onto the standard Hello World demonstration. Now, the point of Hello World is to show an example of getting the simplest thing possible up and running in a new language without being distracted by solving any particular problem. Once we've done the basic Hello World, the next thing will be to introduce JS Bin, which is a tool that I'll be using for the rest of this module to show JavaScript examples.

The Building Blocks of JavaScript ProgramsHi. I'm Liam McLennan. Welcome to the Building Blocks of JavaScript Programs. This module introduces the tools that you will use to construct your programs. These are the brushes with which you will paint your JavaScript masterpiece. First up I'm going to talk about the different kinds of comments that are available in JavaScript programs. Comments are something of a prerequisite when starting with a new program and programming language. You will want to use them to write notes to yourself about the various parts of your application, and it's also helpful to understand the comment syntax to help you read other people's programs, which is a great way to learn. After that I'll take a look at variables. I talked in the previous module a little bit about variables, but here we'll examine the syntax in some more detail. We'll talk about null. It's a special object in JavaScript programs and undefined, which is a similar, yet slightly different primitive type. Sooner or later you will need some assistance, so we'll have a quick look at where we can find help for JavaScript and where the best online documentation can be found. The big subject in this module is objects. We'll go in some detail into the JavaScript notion of an object. And then finally we'll talk about equality, how things compare in JavaScript, and the various things that you need to be aware of there.

FunctionsHi. I'm Liam McLennan. In this module we're going to look at functions. Functions are the core piece of JavaScript. As Douglas Crockford says in this book JavaScript: The Good Parts, "The best thing about JavaScript is its implementation of functions. " But functions do behave differently to other languages, so there are some things that must be understood before they can be used effectively. The first thing we'll do is take a look at a function, have a look at what the function looks like and the parts that make up a JavaScript function. Then we'll take a look at the different approaches that can be used when declaring functions. JavaScript provides a number of similar, but slightly different syntaxes for function declaration. Functions wouldn't be much good if we couldn't call them, so we'll have a look at function invocation and how that works. We'll talk about function overloading and how that applies to JavaScript. We'll look at the Arguments Object, which is a variable that's a special variable that's available inside of every JavaScript function. We'll take a brief look at function recursion, functions calling themselves. And finally we'll end with a discussion of closure and how that's implemented by JavaScript functions.

Control FlowHi. I'm Liam McLennan. This module is about Control Flow in JavaScript. We've talked about objects, we've talked about functions, but to be able to create a program that does something truly useful we need a way to control the flow of execution through our program. That includes being able to branch based on conditions, being able to iterate or repeat certain actions within our program, and having a strategy to handle errors when things go wrong.

FirebugHi. I'm Liam McLennan. This module will introduce Firebug. Firebug is a developer tool add-on for Firefox and an essential tool in every JavaScript developer's toolkit. Firstly I'll introduce Firebug. We'll open it up, have a look, and a very quick tour of what Firebug is and what it looks like. We'll look at Firebug's capability for inspecting the HTML in a page. We'll look at the console facilities provided by Firebug including console logging, reporting of errors, and executing arbitrary scripts. Firebug provides capabilities for inspecting CSS files that are currently loaded. You can also inspect Network traffic and the currently loaded JavaScripts. One of Firebug's killer features is its JavaScript debugging capability. It's definitely one of the better JavaScript debuggers going around. You can do all the normal things like setting breakpoints, conditional breakpoints, viewing callstacks, and watching variables. Firebug is an add-on for Firefox, and YSlow is an add-on for Firebug. It adds performance analysis features to Firebug.

Testing JavaScriptHi. I'm Liam McLennan. Welcome to Testing JavaScript. This module will look at the different reasons why you might want to test your JavaScript and the tools and strategies available to help you with that. The first topic we'll look at is testing. We'll talk about why it's important and what kind of testing you might want to do for your JavaScript applications. We'll talk about QUnit, which is a tool that's part of the jQuery project. It makes it really easy to write JavaScript unit tests. An important topic for web developers is how to write tests that test DOM interactions. So, we're talking about testing JavaScript that interacts with web pages. I'll briefly introduce Behavior Driven Development, something that's become very popular in the last few years, and it applies as much to JavaScript as to every other platform. Specifically, we'll look at how to do Behavior Driven Development tests with a framework called Jasmine. And finally we'll look at ways that we can integrate our JavaScript testing into an automated build process.