9
zedchoo
8y

5 months ago we are using string for identifying some stuff:

var abc = "badstuff/abc"
var isBad = abc.indexOf("badstuff")>-1

// fine

we later switched to id, so

var abc = 13;
var isBad = abc.indexOf("badstuff") > -1;

// well this is wrong

so I approached the colleague and said to her that we use id now, indexOf("badstuff") no longer works, and id can be arbitrary, like 3245.

-- ok ill do it.

I dont know 3245 looks really like a special id or not. this is the outcome:

var abc = 13;
var isBad = abc.indexOf(3245) > -1;

lol.

Comments
Add Comment