Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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.
code
/* 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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Programming The Perl DBI Database Programming With Perl

Authors: Tim Bunce, Alligator Descartes

1st Edition

1565926994, 978-1565926998

More Books

Students also viewed these Databases questions

Question

What are the purposes of promotion ?

Answered: 1 week ago