What is the JavaScript equivalent of MySQL's %LIKE% clause?

it's not exact same as %LIKE% but you can use indexOf().

var str = "Mohsen",
    st = "Moh";

if(str.indexOf(st) > -1) // true

I'm not sure exactly in what context you are using the like operator (e.g. a form field), but you probably want to take advantage of javascript's regular expression object.

A simple example (in your case, for a LIKE query), might look like this:

var regex = /.*ger.*/
var matchesRegex = regex.test(yourString);
if (matchesRegex) {
    //do something
}

Alternatively, you can search for the incidence of your string using the indexOf operation:

var matches = yourString.indexOf("ger") >= 0 ? true : false;
if (matches) {
    //do something
}

search function does not only return whole words. Maybe you are getting confused by the fact it returns zero-based index, so...

// this returns 0 as positive match at position 0
"german shepherd".search('ger')

// this returns -1 as negative match
"german shepherd".search('gerx')

So you need to do comparison of result of search against -1 to see if it is a match or not - you can not just check for true/false.

So you could do...

if(str.search('ger') !== -1){
    // matches string
} else {
    // does not match string
}

// or another way
// add one to convert result to one-based index, and check truthiness
if(str.search('ger')+1){
    // there is a match
} else {
    // there is not a match
}