function sequence(start, step) {
var count = 0;
var a = start || 0;
step = step || 1;
return function(){
if (count === 0) {
count++;
return a;
} else {
count++;
return a+step;
}
}
}// your code goes here
ZnVuY3Rpb24gc2VxdWVuY2Uoc3RhcnQsIHN0ZXApIHsKCXZhciBjb3VudCA9IDA7Cgl2YXIgYSA9IHN0YXJ0IHx8IDA7CglzdGVwID0gc3RlcCB8fCAxOwoJcmV0dXJuIGZ1bmN0aW9uKCl7CgkJaWYgKGNvdW50ID09PSAwKSB7CgkJCWNvdW50Kys7CgkJCXJldHVybiBhOwoJCX0gZWxzZSB7CgkJCWNvdW50Kys7CgkJCXJldHVybiBhK3N0ZXA7CgkJfQoJfQp9Ly8geW91ciBjb2RlIGdvZXMgaGVyZQ==