Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 1,000,000+ packages pre-installed, including wishwash with all npm packages installed. Try it out:

var wishwash = require("wishwash")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

wishwash v1.0.2

Wishwash takes 4 arguments: a value (usually an iterator), a min, a max, and an inclusive qualifier, and counts back and forth between the min and max to your value. Wishwash can be likened to the modulus operator but instead of being used as a single direction counter restarting at the beginning once reaching the max, wishwash counts backwards once reaching the max, forwards again once reaching the min, and continues as such until reaching the value. This has various UI applications, including color animations and various motion demonstrations which otherwise wouldn't be possible without such an algorithm.

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free