1.
var searchString = action + ((action.indexOf('?') == -1) ? '?search=' : '&search=');
2.
var startChar = action.indexOf('?') == -1 ? '?' : '&',
searchString = action + startChar + 'search=' + search + '&filter=';
3.
var hasQM = (/\?/).test(action);
var searchString = action + (!hasQM ? '?' : '&') + 'search=' + search + '&filter='
var searchString = action + ((action.indexOf('?') == -1) ? '?search=' : '&search=');
2.
var startChar = action.indexOf('?') == -1 ? '?' : '&',
searchString = action + startChar + 'search=' + search + '&filter=';
3.
var hasQM = (/\?/).test(action);
var searchString = action + (!hasQM ? '?' : '&') + 'search=' + search + '&filter='