{"ScriptPreparationCode":"var users = { \u0022cust\u0022:{\u0022name\u0022:\u0022philippe\u0022, \u0022id\u0022:\u00221\u0022}, \u0022user\u0022:{\u0022name\u0022:\u0022agnes\u0022, \u0022id\u0022:\u00222\u0022}};\r\nvar arr = [{\u0022id\u0022:\u00221\u0022, \u0022name\u0022:\u0022philippe\u0022, \u0022type\u0022:\u0022cust\u0022},{\u0022id\u0022:\u00222\u0022, \u0022name\u0022:\u0022agnes\u0022, \u0022type\u0022:\u0022user\u0022}];","TestCases":[{"Name":"array","Code":"let t1 = arr.find(function(o) { return o.type == \u0022user\u0022}).name;","IsDeferred":false},{"Name":"attribute","Code":"let t2 = users.user.name","IsDeferred":false},{"Name":"array for","Code":"function find(arr2, a)\r\n{\r\n for (let i=0; i \u003C arr2.length; i\u002B\u002B)\r\n {\r\n if (arr2[i] == a) return arr2[i].name;\r\n }\r\n}\r\n\r\nt = find(arr, \u0022user\u0022)","IsDeferred":false}]}