'contains' method in javascript, extend the String prototype and add y

added by zainshaikh
1/2/2011 7:48:23 AM

0 Kicks, 94 Views

I was just wondering if there is any ‘contains’ method in javacsript. Because I had a string and wanted to search an specific word in that string, I could use indexOf method, but to keep my code more readable, I simply added a new method in the String prototype. You can see the code snippet...