Appendix B: JavaScript Recipes
Gareth Halfacree · 2017
JavaScript RecipesTHIS APPENDIX CONTAINS complete code listings for the programs detailed in Chapter 6, 'JavaScript', and Chapter 8, 'The Wireless BBC micro:bit', presented without comments to make them easier to type in and compare against.When a line of code would extend past the border of the page, a ↩ symbol is printed.When you see this symbol, continue to type the code without pressing the Enter or Return keys.If you're not sure how a line of code should be entered, visit the website at www.wiley.com/go/bbcmicrobituserguide to download plain-text versions of each program; these can then be used for reference or even simply copy and pasted directly into the editors.Chapter 6: Hello, World! (Non-looping) basic.forever(()=> { }) basic.showString("Hello,World!") Chapter 6: Hello, World! (Looping) basic.forever(()=> { basic.showString("Hello,World!") })