I'm sure this is a noob issue but I'm a little confused. My understanding is that when a return statement is reached it should stop the function, however in the example below it doesn't seem to. Would someone please explain what's going on?
var hasTerm = function(obj,term){
$.each(jsonObject,function(key, value){
if (value == term){
console.log("conditional");
return true;
console.log("conditional after return");
};
if(typeof value == (Object || array)){
hasTerm(value,term);
}
});
return false;
}