O'Reilly logo

Programming the BeagleBone Black: Getting Started with JavaScript and BoneScript by Simon Monk

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

5
Arrays, Objects, and Modules
In this chapter you will learn how to use JavaScript arrays, and we illustrate their use with BoneScript to make Morse code signals using the built-in LEDs. You will also be introduced to JavaScript’s concept of “objects,” which provides a very powerful but unusual mechanism for object-oriented programming.
image
Arrays
The variables you have encountered so far have only had a single value. JavaScript arrays are used to contain a list of values. You can think of an array as being rather like a stack of pigeonholes. You can take something out of a particular location, using its index position. In this case, 0 is used to ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required