Common Code Problems solved using JavaScript - please add your own problems and solutions!