JavaScript Objects and Arrays – JavaScript Front Cover

JavaScript Objects and Arrays – JavaScript

  • Edition: 1
  • Publication Date: 2021-05-25
  • ISBN-10: B095XDXD4G
Description

Objectives :
At the end of this chapter you will be able to:

  • Understand the basic features of JavaScript arrays;
  • Understand the fundamental elements of JavaScript arrays;
  • Write HTML files using JavaScript arrays;
  • Explain the JavaScript object model;
  • Use arrays as objects.

Introduction :

Most high level computer programming languages provide ways for groups of related data to be collected together and referred to by a single name. JavaScript offers objects and arrays for doing so. JavaScript arrays are rather different from arrays in many programming languages: all arrays are objects (as in many other languages), but they are also associative arrays. Also, all objects can also be used as if they, too, are arrays.

This chapteris organised into four sections. It introduces arrays and objects separately, then considers arrays as objects, then finally considers objects as (associative) arrays. Many important concepts are covered in this unit, although much of the object technology concepts have been introduced in earlier units.

When working with variables, an important distinction has to be made: is the variable contain the value of a primitive type, or does it contain a reference to a (non-primitive) collection of data. A thorough grounding in the concepts covered in this chapter is necessary to both be able to understand the sophisticated Javascipt scripts written to support complex websites, and to be able to begin developing JavaScript solutions yourself for real world problems. It is important to work through examples until you understand them; write your own programmes that use and test your learning. Programming is learnt through doing as much, or more so, than by reading.

To access the link, solve the captcha.