JavaScript Introduction

https://www.dofactory.com/javascript

JavaScript Introduction

This JavaScript tutorial covers the basics as well as more advanced topics including Inheritance, Immediate Functions, Prototypes, Closures, Currying, Namespaces, and more. Upon completion you will be comfortable adding robust JavaScript functionality to your web pages. However, building world-class web apps requires skills that go beyond this tutorial. For that you will need our Dofactory JS which teaches how to write robust, maintainable, and beautiful web apps using proven design patterns and pattern architectures. To learn more click here. Both this tutorial and our Dofactory JS come with code samples that demonstrate the concepts in action. Each time you see a 'Run' button, it will execute the code displayed, like so:

alert("I am ready to run!");      // => I am ready to run

Run

Here is a rundown of the 15 chapters in the tutorial:

This introductory page in which we provide an overview of the different chapters and their contents.

In this chapter we review the JavaScript language. You will learn that JavaScript is object-oriented but that it does not support classes. Inheritance is implemented through a mechanism called prototypes. We compare JavaScript to other languages and provide an answer to the question: 'is JavaScript related to Java?' -- let's go

Before you start writing JavaScript code is it important that you have a good grasp of the language and its development environment. Here we review language fundamentals, case-sensitivity, commenting, and several important tips and techniques on how to write, debug, and perform validation in JavaScript -- let's go

JavaScript is not a type-safe language which can make declaring and using variables tricky. You will learn about global variables, variable scope, variable hoisting, and how the the single-var pattern can help you avoid some common pitfalls. -- let's go

JavaScript supports a set of operators that you have come to expect from a mature language. However, some JavaScript operator behave in unexpected ways. We will present each of the operators available in JavaScript including arithmetic, assignment, comparison, logical/boolean, and finally string operators. -- let's go

In this chapter we show how you would use JavaScript conditionals, including if, if else, if else if else and the switch statement. You will also learn how to avoid a common switch coding problem. -- javascript-conditionalslet's go

In this chapter we present the looping constructs available in JavaScript. These include for loops, do loops, while loops, continue and break. We will also discuss for in loops which allow you to iterate over object properties. -- let's go

JavaScript includes built-in types, such as String, Boolean, Number, Date and Math. Here we discuss how to create these types and how to access their properties. We will show you how to work with implicit and explicit Number to String conversions. Finally, the Date object and the Math object are presented. -- let's go

Now we are getting to the very heart of the language; everything in JavaScript is an object. We discuss object literals followed by object properties and how to dynamically add, retrieve, update, and delete properties from an object. JavaScript is a prototypal language and we will show how to use this to implement inheritance. -- let's go

JavaScript is object-oriented, but it lacks several features that you've come to expect from a mature object-oriented language. There are ways to solve this with a series of advanced concepts including namespaces, modules, chaining, and closures. We also show you how to keep members private in objects. -- let's go

Next, you will learn about JavaScript arrays. We show how to create arrays using array literals and some other options. We will also explore ways to effectively iterate over array elements. Multi-dimensional arrays are easily implemented in JavaScript. Finally, we show you can assign arrays their own methods. -- let's go

As a JavaScript developer it is essential that you are comfortable working with functions because they play a critical role in building robust applications. We will discuss function literals and function constructors. You will also learn about variable scope, function closures, and the important immediate functions. -- let's go

Functions are first-class citizens in JavaScript; they are objects, but better. When programming in JavaScript it is necessary that you move beyond the notion of function being a reusable block of code. Most large-scale JavaScript projects choose functions over objects. We will discuss why this. Also discussed are callbacks, currying, memoization, and the use of functions as building blocks of project modules. -- let's go

JSON (JavaScript Object Notation) is taking the world by storm, even in non-JavaScript environments such as .NET, Java, Ruby, and PHP. We discuss what JSON is, why it is so popular and how it compares to XML. You will learn how to parse JSON and why Ajax and JSON are a 'match made in heaven'. -- let's go

Regular expressions provide a powerful way to perform pattern matching on certain characters within strings of text. They offer a concise syntax to carry out complex tasks that otherwise would require lengthy code. In this chapter we will demonstrate how to build JavaScript regular expressions in your apps. -- let's go

Designing powerful applications with JavaScript Design Patterns -- let's go

In this final chapter we offer a quick JavaScript reference guide. -- let's go

Last updated

Navigation

Lionel

@Copyright 2023