Using JavaScript, write a function that accepts two numbers and returns them multiplied together.
Using
.map()and.forEach(), add the necessary JavaScript to print out each of the words with an!appended to the end, such as:
One!
Two!
Three!
Four!
Five!
const words = [{
content: "One",
},{
content: "Two",
},{
content: "Three",
},{
content: "Four",
},{
content: "Five"
}]Write the code to create a component named
HelloWorld. It should have the template<p>Hello, world!</p>!
Write the code to create a component named
DisplayMessage. It should accept a prop calledmessageand display it in<p></p>tags.
Write the code to import a React component named
Avatarusing ESM syntax. Export a React component namedUserCardthat has a single prop calleduser. Use theAvatarcomponent as the template for theUserCardcomponent, passuser.avatarUrlinto a prop namedurl.
Write the code to export a React component named
StopAndGothat takes a boolean prop calledactive. Ifactiveis true, the component should display<span>Go!</span>, otherwise it should display<span>Stop!</span>.
Write the code to import a React component named
ListItemusing ESM syntax. Export a React component namedUnorderedListthat accepts an array calleditemsas a prop. In the template, iterate through theitemsarray and create a new instance ofListItemfor each item, passing the item into thecontentprop forListItem.
Write the code to export a React component called
LoginForm. It should have 2 labeled inputs forusernameandpassword, both of which should be logged to the console when the form is submitted.
Using the API endpoint https://pokeapi.co/api/v2/pokemon/pikachu, write the code to create a component that fetches a Pikachu object and displays a sprite (eg.
pikachu.sprites.front_default) in an<img />.
Change this code to use context instead of props:
function Outer(){
return <Inner prop="prop" />
}
function Inner({prop}){
return <p>{prop}</p>
}What is a hook?