In my object loop using the earch function
how to find the value as "just a string" - or "array" - or "object" - while loop through..?
In case if I find the value as "array" - then i suppose to re-loop the array. But how can i find the value as loop-able or returnable using jquery..?
myobject :
var input = {
"DashBoard": [
{
"title": "DashBoard" //non-loopable
}, {
"widget": [{ //loop-able - it could be a object (so loop-able)
"slide": "To do"
}, {
"slide": "Teamspace"
}, {
"slide": "Recent Activity"
}]
}
]}
But using the Jquery type - return always object. what is the way to find the object value to distinguish between value and array or object..?
my try:
$.each(input.DashBoard, function (index, item) {
console.log(index, $.type(item)); //always return object..!
} )
what would be the correct way..