After integrating the spectrum color picker, I'm currently working on resolving the JSLint errors that have appeared. There are two specific types of errors that I'm struggling to rectify. Here they are:
- Unexpected '~'
- Unexpected 'in'. It is recommended to compare with undefined or use the hasOwnProperty method instead.
Let's take a look at the code related to the first error:
function contains(str, substr) {
return !!~('' + str).indexOf(substr);
}
And now, here's the code associated with the second error:
var hasTouch = ('ontouchstart' in window);