function getParentwithclass (doc, className) I/ finish this function so // the a
ID: 3903732 • Letter: F
Question
function getParentwithclass (doc, className) I/ finish this function so // the asserts don't fail let parentTrap // test data foo: bar class: com.trivir.top', parent: ( foo: "baz, class: com.trivir.half.high', parent: f foo: 'quux' class: com.trivir.mid.level' parent: f foo: batshit', class: 'com.trivir.half.low', parent: foo: cat class: com.trivir.bottom parent: f foo: "moneyball' class: com.trivir.who.cares' parent: null console.assert(// positive test getclassFromParent (parentTrap, com.trivir.mid.level')-sparentTrap Should have found this class .parent.parent, console.assert(/ negative test getclassFromParent (parentTrap, com.trivir.Huston.cares'), Should NOT have found this class'Explanation / Answer
Hi. please find the answer above.. i have given comments so that it is very easy for you to understand the flow. In case of any doubts, please ask in comments. If the answer helps you, please upvote. Thanks!
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.