Book Image

Web Developer's Reference Guide

By : Joshua Johanan, Talha Khan, Ricardo Zea
Book Image

Web Developer's Reference Guide

By: Joshua Johanan, Talha Khan, Ricardo Zea

Overview of this book

This comprehensive reference guide takes you through each topic in web development and highlights the most popular and important elements of each area. Starting with HTML, you will learn key elements and attributes and how they relate to each other. Next, you will explore CSS pseudo-classes and pseudo-elements, followed by CSS properties and functions. This will introduce you to many powerful and new selectors. You will then move on to JavaScript. This section will not just introduce functions, but will provide you with an entire reference for the language and paradigms. You will discover more about three of the most popular frameworks today—Bootstrap, which builds on CSS, jQuery which builds on JavaScript, and AngularJS, which also builds on JavaScript. Finally, you will take a walk-through Node.js, which is a server-side framework that allows you to write programs in JavaScript.
Table of Contents (22 chapters)
Web Developer's Reference Guide
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
9
JavaScript Expressions, Operators, Statements, and Arrays
Index

Arrays


Arrays are use to store ordered collections of data. If we have multiple items, then we can use arrays to store these values. Array prototype methods are used to perform mutation operations in JavaScript. There is no fixed length of an array. An array can contain multiple value types and the number of items can be mutated at any point after initialization.

Array types

There are two array types in JavaScript:

  • Nominal type: This type of array has a unique identity.

  • Structure type: This array type looks like an interface; it is also known as duck type. It uses a specific implementation of a behavior.

Note

Sparse array

In programming languages, a sparse array denotes an array that has the same values such as 0 or null. There is a large number of zeroes in an array storage, which occurs in a sparse array. In a sparse array, indexes do not start from 0. In a sparse array, lengths of the elements are less than the length of the property.

In JavaScript, the length property is not the actual amount...