Search code examples
javascriptasp.net-mvcreflectionjsonresult

Javascript Reflection - Get properties of a JsonResult object


I have a object that returned from JsonResult
I want to get all properties of object in client, like C# Reflection


Solution

  • for(var property in object){
     if(object.hasOwnProperty(property)){//prevents from getting inherent properties
       console.log(object[property])
     }
    }