Remakers - 3.13 Developing Procedures JS Hacks
Categories: JavaScriptApply your skills to basic procedure development in Javascript.
Q1 (Easy)
Which of these procedures is named wrong, provide a short explanation of justification
%%js
function mixIngredients()
function doIt()
function makeLeftTurn()
Explanation Here: “function mixIngredients” is right because..here in this case it specifically mentions an action by using a verb, allowing the readers to know what they specifically mean.
Q2 (Medium)
Finish the code to have a correctly named procedure
%%js
function moveForward() {
console.log("Moving forward.");
}
function rotate180() {
console.log("Turning left.");
}
function moveForwardAgain() {
console.log("Moving forward again to complete left turn.");
}
function makeLeftTurn() {
moveForward();
rotate180();
moveForwardAgain();
}
// Run the procedure
makeLeftTurn();
### Q3 (Hard)
Write code to fulfill the requirements
Doing a dance! 🕺💃
Must have
1. A shimmy left procedure
- Print `super cool left slide`
2. A shimmy right procedure, print `even cooler right slide`
3. Doing a bow to the crowd, print `Great dance!`, `the audience claps at your bow!`
%%js
console.log("Doing a dance! 🕺💃");
function shimmy_left_procedure() {
console.log("super cool left slide");
}
function shimmy_right_procedure() {
console.log("even cooler right slide");
}
function bow_to_the_crowd() {
console.log("Great dance!");
console.log("The audience claps at your bow!");
}
// Run the dance routine
shimmy_left_procedure();
shimmy_right_procedure();
bow_to_the_crowd();
<IPython.core.display.Javascript object>