O'Reilly logo

The Official BBC Micro:bit User Guide by Gareth Halfacree

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

Chapter 6

JavaScript

In this chapter

check An introduction to programming in the JavaScript Editor

check ‘Hello, World!’: Your first JavaScript program

check Programs for reading from button inputs, touch inputs, and the temperature, accelerometer, and compass sensors

check Fruit Catcher: A simple game to program and play on your BBC micro:bit

THE JAVASCRIPT LANGUAGE is a popular choice for beginners, with its easy-to-understand format and layout. It’s also one of the most common languages underpinning the World Wide Web. When you visit a web page and it has interactive content, that content is almost always powered by JavaScript. If you’ve previously worked through Chapter 5, ‘JavaScript Blocks’, then you’ve already had an introduction to how the language works: Programs created in the JavaScript Blocks Editor are invisibly transformed into JavaScript code as you build them, and it’s this code that is compiled and run on your BBC micro:bit or in the simulator. Technically speaking, the language used on the BBC micro:bit is a version of TypeScript on top of JavaScript, but this combination is most commonly ...

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