Various exercises in js (using node)