In the previous two installments (one, two) we explored the use of callbacks through creating a mapp
function for arrays (so called because the latest JavaScripts have a native map method already), and through creating a mapAsync
function where the work is done asynchronously rather than serially. The reason for this was so that we could avoid triggering the browser’s “script running a long time” warning and, also, more importantly, provide the user with a responsive UI. […]
Last time, we wrote a map method for arrays (which I had to call mapp
, so that we didn’t clash with the native version present in many browsers). To use the map method, you have to provide a callback function that would be called for every element in the array. […]
As I’ve said pretty much from the very start of this series: functions are objects. You can pass them around in variables, pass them into functions as parameters, return them from functions, the whole nine yards. When you pass a function into another where it will be called, it’s generally known as a callback. […]
READ MOREBy March 2010, I was starting to move to a more “how it works” style of article to go along with changes in the magazine, rather than a “layman’s guide to algorithms” article which I’d traditionally done. This article on GPS systems (or sat-nav, if you’re in England) was my first real attempt at such an article: select some technology and explain its underpinnings for the lay audience. […]
READ MOREFor February 2010’s issue, it was time for a more heavy-duty algorithm together with what my editor called a fun element. So, enter minimax and two-player zero-sum games. […]
READ MOREA familiar topic for me for the January 2010 issue: testing a pseudo-random number generator’s (PRNG) output for randomness. I say familiar because I’ve talked about it before, most recently in my book. Well, OK that was 10 years ago, but still, the techniques don’t change. And it’s extremely fascinating, to boot. […]
READ MOREphoto © 2010 Bill Abbott | more info (via: Wylio)Long ago someone signed me up to get emails from this wacko right-winger. Her emails are unfailingly stupid/vapid, forwarded ad nauseam, written in deathless, breathless prose, and the all-caps multi-exclamation-marked topics are easily debunked by 5 seconds research on snopes.com. Consequently they are hilarious. […]
READ MORE