Home » 2022 » March

How to use the JavaScript ‘while’ Loop, With Examples

JavaScript While Loops

This article will show you how a JavaScript while loop is constructed, and what it us used for, with code examples. While loops are one of the simplest kinds of loops, and appear in most programming languages. A while loop runs a block of code repeatedly, until a condition is met. When the while condition is met, the loop stops. It’s important to get comfortable with using loops – and understanding how they work – as they form the backbone of just about every game and application you might write. Make sure you’re familiar … Read more

Home » 2022 » March

JavaScript Print – To the Console, WebPage, or a Printer [Examples]

JavaScript Print to Printer, Console, Page

You’ve searched for ‘JavaScript Print’ – so you’re probably trying to output data to the console, to the webpage or to a printer. Here’s how to do all three. Printing to the Console with console.log() The JavaScript console.log() method prints data to the JavaScript console (visible in your browsers web inspector). Any type of data can be logged to the console, including strings, numbers, arrays, and objects, and either the contents of, or a text representation of, the value will be displayed. console.log() is frequently used for debugging – developers use it to view … Read more

Home » 2022 » March

DIY Raspberry Pi Chopping Board HomeLab

Raspberry Pi Chopping Board Lab

Here’s an odd solution I came up with to deal with the tangled mess that is my Raspberry Pi HomeLab – mounting it on a cheap kitchen chopping board. There’s not a lot more to be said for it really – it’s a Raspberry Pi attached to a chopping board. But why? I noticed that the micro-HDMI connection to the Pi was getting wonky – every time I shifted things around force was applied to the tiny connector.  I wanted to mount the Pi and … Read more