{"ScriptPreparationCode":"var users = [\r\n { \u0027user\u0027: \u0027barney\u0027, \u0027active\u0027: false },\r\n { \u0027user\u0027: \u0027fred\u0027, \u0027active\u0027: false },\r\n { \u0027user\u0027: \u0027pebbles\u0027, \u0027active\u0027: true }\r\n];","TestCases":[{"Name":"_.findIndex","Code":"_.findIndex(users,val=\u003Eval.active)","IsDeferred":false},{"Name":"my findIndex","Code":"var is_array = function (value) {return value \u0026\u0026 typeof value === \u0027object\u0027 \u0026\u0026 typeof value.length === \u0027number\u0027 \u0026\u0026 typeof value.splice === \u0027function\u0027 \u0026\u0026 !(value.propertyIsEnumerable(\u0027length\u0027));};\r\n\r\nfunction findIndex(array,iteratee)\r\n{\r\n if(!is_array(array))\r\n return -1;\r\n if(typeof iteratee===\u0027function\u0027)\r\n return array.findIndex(iteratee)\r\n \r\n //\u00A0The\u00A0\u0060_.property\u0060\u00A0iteratee\u00A0shorthand.\r\n if(typeof iteratee==\u0027string\u0027)\r\n return array.findIndex(val =\u003E _.get(val,iteratee))\r\n \r\n //\u00A0The\u00A0\u0060_.matchesProperty\u0060\u00A0iteratee\u00A0shorthand.\r\n return array.findIndex(val=\u003E_.get(val,iteratee[0])===iteratee[1])\r\n}\r\n\r\nfindIndex(users,val=\u003Eval.active)","IsDeferred":false}]}