Original code:
/** * @param {HTMLElement} parent The jQuery object wrapping the parent * @param {string} relativeName The name of the relative to be searched * @return {HTMLElement} The jQuery object wrapping the closest relative */ function closestRelative(parent, relativeName) { // Implement function here return null; } // Example case $('body').html( '
' + '
' + '
' + '
' + '
' ); let parent = $('James').eq(0); let relative = closestRelative(parent, 'Mike'); console.log(relative && relative.prop("tagName"));
Dashboard
Start Trial
Sign In
Home
Product
Features
Use Cases
Customers
ROI Calculator
Integrations
Assessments
Tests
Questions
Pricing
Resources
Book: Evidence-Based Hiring
Blog
Support
Contact Us
Legal
For Jobseekers
© TestDome, 2024.