Below are a few basic recusion examples written in JavaScript.