Inductive programming in JavaScript