I have the following javascript functions:
function fun1()
{
...
return 'Over';
}
function fun2()
{
...
return 'Hello';
}
function fun3()
{
..
return 'Over';
}
function fun4()
{
..
return 'Over';
}
function fun5()
{
...
return 'Bye';
}
....
var errmsg='';
errmsg+=fun1();
errmsg+=fun2();
errmsg+=fun3();
var newmsg = errmsg;
if (newmsg.match('Over'))
{
checklist();
}
so as per the code, if fun1() and fun2() are true, errmsg= 'OverHello', and if fun1() and fun3() are true, errmsg = 'OverOver'
I want newmsg to match ONLY with the functions that return 'Over'...so if errmsg='Over' or 'OverOver' or so on, ONLY then it would run the function checklist().
Is there any way, I can check this condition using string methods (like match, contains, etc)?
Please help.