startswith() and endswith() in JavaScript 1.5
MochiKit is a great JS library but JavaScript itself kinda sucks at string manipulation (if you’re a Pythonista it sucks a lot).
While I was fixing and improving the features of a web application I ended writing awful code to check if some string was at the beginning of some other string. I, then, decided to write a JavaScript version of Python’s startswith and endswith.
The two functions are in with.js and their tests are in test_with.js.
I also sent a patch to MochiKit so if they accept it we Pythonistas can all have our little sense of being home (and actually MochiKit does a great job to make Python developers feel in the right place!).

