{"ScriptPreparationCode":"var person = {name: \u0027Frederick\u0027, lastName: \u0027Corcino Alejo\u0027, sub: { test: \u0022oui\u0022, subsub: { en: \u0022yes\u0022, fr: \u0022oui\u0022} }};","TestCases":[{"Name":"Lodash get","Code":"_.get(person, \u0027sub.subsub.en\u0027);","IsDeferred":false},{"Name":"Native","Code":"person.sub.subsub.en","IsDeferred":false},{"Name":"Own get","Code":"function get(object, path, defaultValue) {\r\n // Divisez le chemin en un tableau de cl\u00E9s de propri\u00E9t\u00E9\r\n const keys = path.split(\u0027.\u0027);\r\n\r\n // Parcourez les cl\u00E9s de propri\u00E9t\u00E9 pour acc\u00E9der \u00E0 la valeur\r\n let value = object;\r\n for (const key of keys) {\r\n if (value == null) {\r\n return defaultValue;\r\n }\r\n value = value[key];\r\n }\r\n\r\n // Si la valeur est nulle ou ind\u00E9finie, retournez la valeur par d\u00E9faut\r\n if (value == null) {\r\n return defaultValue;\r\n }\r\n\r\n // Sinon, retournez la valeur trouv\u00E9e\r\n return value;\r\n}\r\nget(person, \u0027sub.subsub.en\u0027);\r\n","IsDeferred":false}]}