Question: the file ` speak . page.jsx ` will execute. Currently the component renders a Failed message. You need to update the ` speak ` function

the file `speak.page.jsx` will execute. Currently the component renders a "Failed" message. You need to update the `speak` function such that the component renders that a "Passed" message. You can only edit the code inside the `speak` where indicated and nowhere else.
/* eslint-disable */
// The only code you may write in this file is inside the `speak` function.
// Add the necessary code in the `speak` function so that the page displays a "Passed" message.
const { log, clearLogs, getLogs }=(()=>{
let logs =[];
return {
log: (msg)=> logs.push(msg),
clearLogs: ()=>{
logs =[];
},
getLogs: ()=>[...logs],
};
})();
export default function SpeakPage(){
clearLogs();
speak((hello, hey, sup)=>{
hello("ragnar");
hey("lagertha");
});
speak((sup)=>{
sup("floki");
});
speak((king, greeting, your, majesty, sup)=>{
exec({ king, greeting, your, majesty, sup });
});
function exec({ king, greeting, your, majesty, sup }){
king("ecbert")(greeting)(your)(majesty);
king("harald")(sup);
}
const logsAreCorrect =
getLogs().join("
")===
`hello ragnar
hey lagertha
sup floki
king ecbert greeting your majesty
king harald sup`;
return (

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!