A JavaScript function that tells which of its line(s) have been deleted
December 2013
A stackexchange challenge
Best JS solution for 0 or 1 deleted line: 78 bytes
(function(n){
a=n-=1
n-=2
+3
+4;if(this.a)return 5
return n;var a
})(10)
link
Best JS solution for 0 / 1 / 2 deleted lines: 213 bytes
(function(r){
r.shift();
r.splice(r.indexOf(2),1)
r.splice(r.indexOf(3),1);a=b=1;if(this.a&&this.b)return r
var a;r.splice(r.indexOf(4),1);b=1;if(this.b)return r
var b;r.pop();return r[0]?r:0
})([1,2,3,4,5])
link