Hello I have a string could be like this
var str = "127";
or
var str ="127,5,28,12";
I want to check if number exist I don't want to add it again. So I use
if(!str.includes(id))
// do so and so
But the problem with includes
is that If I search for 1 it will get it from 127 and that's not accurate. Is there a better way to detect exact number in js?