EndangeredSpecies
jQuery JavaScript Selectors Public
jQuery
jQuery is a fast, small, popular, and feature-rich JavaScript library. It provides functions that make it easier for developers to traverse HTML documents, create animation, support different browsers, handle events, and use Ajax.
JavaScript
JavaScript is the programming language of HTML and the web. It's an essential skill for any programmer working with websites and web technologies.
Selectors
Selectors are a programming pattern that can be used to select an element from a container. They are primarily used in technologies such as CSS and JQuery to apply styles to groups of elements.
Public
Public questions (free account) are common interview questions. They are great for practicing, or if you want to filter candidates using the classic problems.
An HTML div element contains lists of endangered species grouped by continent and the species population status.
<div> <ul data-continent="North America"> <li data-species="California condor">Critically Endangered</li> <li data-species="American bison">Near Threatened</li> </ul> <ul data-continent="Europe"> <li data-species="Cave bear">Extinct</li> </ul> </div>
Write a function that returns how endangered a species is on a particular continent. For example endangeredSpecies('North America', 'American bison') would return 'Near Threatened'.
ECMAScript 6, jQuery v3.2.1 (available as $)
- Example case: Wrong answer
- Several species and continents: Wrong answer
- Continents with the same species: Wrong answer