javahacker.com

The Java Hacker – Peter Jaric's Blog

Tag: javascript

Mathemancy.js – a Framework for Natural Language Arithmetic in JavaScript

A while ago, while I was riding my bike to work, I thought: “Would it possible to make one.plus.two.times.three evaluate to 7 in JavaScript?” I wanted to see if it was possible, and with some invaluable help from Mathias Bynens and Ingvar Stepanyan I was able to make it work. I give you: Mathemancy.js With […]

A JavaScript challenge for Nordic.js

Today and yesterday I’ve been visiting Nordic.js, a Scandinavian JavaScript conference. To celebrate the occasion I made a little JavaScript challenge that I announced at Twitter: I had a specific solution in mind, which I didn’t receive, but I got a load of other solutions instead: The first one was from Andreas Madsen and it […]

Matching combined results in jQuery – ordered correctly

Today I used the “selector1, selector2, selectorN” selector in jQuery and was confused that, in some cases, when looping over the results I got them in the order of the selectors and not in the order of the elements in the page. I had expected it to work as an OR operator. My code looked […]

Modules in Javascript

JavaScript does not have modules builtin, but since it is such an open language, it is possible for the developer to create a custom module system. Looking around on the web, it is soon obvious that there are several ways to do this. Here I will present that path I have taken. I have chosen […]