Book Image

JavaScript (and jQuery) in 7 Days [Video]

By : Michael Rosata
Book Image

JavaScript (and jQuery) in 7 Days [Video]

By: Michael Rosata

Overview of this book

JavaScript is the language of the web. You can use it to add dynamic behaviors, store information, and handle requests and responses on a website on-the-fly and this is why it has become one of the most useful languages in the web development community. In this course, you will instantly start to work with JavaScript, jQuery, and Bootstrap using the in-browser editor. You'll start off by learning the basics of JavaScript by writing your first program. After mastering the fundamentals, you'll learn how to write clean and maintainable JavaScript code. You'll be taught modern JavaScript at a quick pace to maximize your learning for the time available. Later you'll work with objects and arrays to model problems/solutions for better program output in JavaScript. You'll be creating an awesome-looking battleship game with slideshows, a development journal with YouTube, and image-embedded URLs with Bootstrap and jQuery. Each lesson will begin by reviewing the exercise from the previous day, before moving on to the subject of that day's lesson. By the end of the course you will be amazed by everything you've managed to learn and accomplish in such a short time. Each lesson is inspiring and fun, making you feel like a magical code wizard! All the code and supporting files for this course are available on GitHub at: https://github.com/PacktPublishing/JavaScript-and-jQuery-in-7-Days
Table of Contents (7 chapters)
Chapter 2
Working with Arrays and Keeping Control of Your Code
Content Locked
Section 3
Writing Less Code Using “for” and “while” Loops
When dealing with Arrays, we’ll often need to do some task on or with each individual item in the array. Since we don’t always know how many items are in an Array, and since we would be writing the same code over and over, instead we can use “loops”. - Arrays length property tells us how many items it has - Write a for loop to iterate an array - Use a while loop as an alternative to the “for” loop