skinnyla.blogg.se

Test javascript online
Test javascript online











test javascript online

The email paragraph element should be added to the DOM after the name is clicked, and it should be removed from the DOM when the name is clicked again.įor example, the following code: document.body. At first, the email paragraph element should not be present in the DOM. The name and email properties should be added as two paragraphs inside the list item. The second argument to the function, targetList, is an unordered HTML list to which each customer should be added as a separate list item. The first argument to the function, customers, is an array of objects with the name and email properties. Access Microsofts entire catalog of software for dev/test use. Implement the showCustomers function so that it renders customers as list items. The top pick for JavaScript and web developers, with extensions to support just about any. Let relative = closestRelative(parent, 'Mike') Ĭonsole.log(relative & relative.tagName) // prints MIKE If no matching relative is found the function should return null.įor example, the below code should print 'MIKE' for the given family tree: let parent = document.getElementsByTagName('James').If several children in the same generation have the same name, then the first child in the tree is considered the closer relative. The JavaScript online test assesses knowledge of programming in the JavaScript language and core front-end web development concepts.

test javascript online

Children are more closely related to the parent than grandchildren.Each member of the family, including children, may also be a parent to one or more children.The parent parameter is the HTML element of which the closest relative will be a descendant.Implement the closestRelative function so that when a parent HTML element is passed, the function returns the parent's closest relative whose name matches the relativeName, and obeys the following rules: The following HTML represents a family tree:













Test javascript online