{"ScriptPreparationCode":"\r\n \r\nBenchmark.prototype.setup = function() {\r\n var isParent = function(el) {\r\n return el.classList.contains(\u0027parent\u0027);\r\n }\r\n\r\n var findParent = function(el) {\r\n if (isParent(el)) return el\r\n if (!el.parentNode) return false\r\n return findParent(el.parentNode)\r\n }\r\n var element = document.getElementsByClassName(\u0027child-last\u0027)[0];\r\n};","TestCases":[{"Name":"Closest","Code":"element = element.closest(\u0027.parent\u0027)","IsDeferred":false},{"Name":"Loop","Code":"while (element) {\r\n if (isParent(element)) break;\r\n if (!element.parentNode) break;\r\n element = element.parentNode;\r\n}","IsDeferred":false},{"Name":"Recursion","Code":"element = findParent(element)","IsDeferred":false}]}