Longest Move StreakI’m into the second half of my thirties now, and for the last decade or so, my weight had been slowly creeping up. When you’re a teenager, your body seems to be able to burn off enough calories to make up for a bad diet. But, as you get further into your twenties, something happens, and you start to put on weight instead of burning off all those bad-food calories. Eating is something I tend to be very habitual about, so while I made a conscious decision to eat better and exercise more, that never seemed to change anything. I would just continue to eat like I did before, almost as if I was on auto-pilot. I’d find myself eating a Mars bar at 3pm in the afternoon, not because I wanted one, or even because I’d chosen to have one, but because that’s what I’d always done at 3pm, and my body would just move towards the vending machine a that time without any conscious thought at all!

I’d been meaning to tackle my weight for years, but this year, after many false starts, I’m finally succeeding, and the difference with previous failed attempts is technology.

Read more

Tagged with:

This post is part 19 of 92 in the series Programming by Stealth

While recording instalment 18 of the Programming by Stealth series, I promised Allison some challenges to help listeners test and hone their understanding of the core JavaScript language. Since we’ve now covered pretty much the whole language in the series, it’s the perfect time to pause and consolidate that knowledge.

These challenges are designed to be run in the PBS JavaScript Playground. You may also find the PBS JavaScript cheatsheet helpful.

Read more

Tagged with:

This post is part 18 of 92 in the series Programming by Stealth

We’ve now covered most of the core JavaScript language. We’ve learned that variables can store literal values, or references to objects. We’ve learned there are three types of literal values – numbers, booleans, and strings. We’ve learned about operators. We’ve learned about conditionals. We’ve learned about loops of various sorts, and we’ve learned about objects. We’ve learned that in JavaScript, arrays are implemented as objects with the prototype Array, and that functions are also implemented as objects.

Before we can leave the playground and head off into the world of the browser, we just have a few more loose ends to tie up, which we’ll take care of in this instalment.

Now that we know about objects, we need to re-visit the arguments object present in every JavaScript function. We need to take a detailed look at the typeof operator, and we need to look at some built-in objects and functions JavaScript provides.

We also need to look at how JavaScript handles regular expressions, and finally, we need to introduce the concept of exception handling.

Read more

Tagged with: