/javascript_koans

Sing a koan to Javascript

Primary LanguageJavaScriptMIT LicenseMIT

Learn JavaScript with the Koans#

It's been said before: "Koans are small lessons on the path to enlightenment. The aim of the JavaScript Koans project is to provide an easy learning environment in JavaScript. Your insight will be derived by encountering failing tests and fixing them so that they pass. A testing framework is used to simplify this process and to get you off to a good start with using JavaScript."

When you first run the koans, you'll be presented with a runtime error and a stack trace indicating where the error occurred. Your goal is to make the error go away. As you fix each error, you should learn something about the Javascript language and functional programming in general.

Your journey towards Javascript enlightenment starts in the koans/AboutExpects.js file. These koans will be very simple, so don't overthink them! As you progress through more koans, more and more Javascript syntax will be introduced which will allow you to solve more complicated problems and use more advanced techniques.

Running the Koans from a Browser

Open koans.html in your browser of choice. Any browser will do, but for the best results Firefox or Chrome is recommended. More stack trace information shows up for javascript on these browsers.

The first error will be in koans/AboutEquality.js. Fix the first test and refresh the browser. Rinse and repeat until all tests turn green.

The test runner used is Jasmine with a customized report viewer.

Project notes

When I first encountered the concepts of Koans in Scala, I was very excited to apply the same technique to javascript. On looking in Github I did find two other fine projects. Neither of them was exactly the experience that I'd encountered in those Scala Koans, so I've taken the features I've like from both, to bring the experience closer to what I remember enjoying in the Scala version, with some embellishments of my own.

Changelog

  • v0 - Oct 2012 - Based on the excellent projects of:
  •   David Laing - https://github.com/mrdavidlaing/javascript-koans
    
  •   Liam McLennan - https://github.com/liammclennan/JavaScript-Koans
    

Inspirations & thanks

License

This software is (c) 2012 Scott Langeberg, and licensed under the MIT license (see LICENSE for details). Enjoy!