You (brian) are allowed to change the cleaning code, but nothing else.
Can you reach the throne?
You (brian) are allowed to change the cleaning code, but nothing else.
Can you reach the throne?
function foo() { | |
// Let the boy clean the castle | |
document.write("Cleaning") | |
// WRITE CLEANING CODE HERE | |
// END CLEANING CODE | |
document.write("<br/>") | |
// NOT ALLOWED TO CHANGE FROM HERE | |
const castle = ( | |
name, | |
throneProof = undefined | |
) => { | |
document.write("Hello,", name, '<br/>') | |
if (throneProof != null) { | |
document.write("<strong>WELCOME TO THE THRONE!</strong><br/>") | |
} else { | |
document.write("<em>Keep cleanin', sucker!</em><br/>") | |
} | |
} | |
function guard(name) { | |
if (name === 'King') { | |
castle(name, true) | |
} else { | |
castle(name) | |
} | |
} | |
guard("King") | |
document.write("<br/>") | |
guard("brian") | |
} | |
foo() |