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: doIt() is named wrong because it doesn’t describe what the procedure actually does. Procedure names should clearly indicate their purpose or action (like mixIngredients() or makeLeftTurn()), so someone reading the code can understand it easily without seeing the details.
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();
}
makeLeftTurn();
<IPython.core.display.Javascript object>

### 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
function shimmyLeft() {
console.log("super cool left slide");
}
function shimmyRight() {
console.log("even cooler right slide");
}
function bowToCrowd() {
console.log("Great dance!");
console.log("the audience claps at your bow!");
}
shimmyLeft();
shimmyRight();
bowToCrowd();
<IPython.core.display.Javascript object>
