Chapter 6
In this chapter
An introduction to programming in the JavaScript Editor
‘Hello, World!’: Your first JavaScript program
Programs for reading from button inputs, touch inputs, and the temperature, accelerometer, and compass sensors
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 ...
No credit card required