I've never worked with js before and now faced with a problem, how can I do next?
function test()
{
$(xml).find("strengths").each(function()
{
$(this).each(function()
{
(if some condition)
{
//I want to break out from both each loops at the same time here.
// And from main function too!
}
});
});
}
I understand that to stop one loop I just need to return false
. But what to do if I have some nested? And how to return from main function?
Thanks all!
You could use two variables: