Minimalistic Javascript puzzle written to test AngularJS framework