Skip to content

Latest commit

 

History

History
55 lines (41 loc) · 1.98 KB

class-07.md

File metadata and controls

55 lines (41 loc) · 1.98 KB

Class 07

Thursday Morning June 29th 2023

Resources

Notes

  • DRY: Don't Repeat Yourself

Q&A's

Questions

  1. What is control flow?
  2. What is a JavaScript function?
  3. What does it mean to invoke - or call - a function?
  4. What are the parenthesis () for when you define a function?

Answers

  1. this is the order in which things are executed in a program/script
  2. a function is a block of code that performs a certain task. It can be reused and called as many times as is necessary.
  3. this is the act of calling the function to execute the task. One typically invokes or calls the function by using its name, and passing it necessary arguments. Worth noting: those arguments passed to the function, are now known as its parameters.
  4. The parenthesis invokes/calls the function, they also provide the bounds in which arguments are passed to the function

Instructions for my robot

function insert_left_arm() {

if (coat is inside out) { turn coat back to normal; }

lift coat; make the front of the coat face you; place your Left arm into the sleeve on the Right side of the coat; if (arm is hard to get in) { hold the top of the sleeve with your other hand; } insert arm all the way until your hand comes out, up to your wrist. move the coat to your back side, so that the right sleeve is hanging close to you; lift your gith arm, and slide it into the right sleeve hand first;

if (arm is hard to get in) { hold the top of the sleeve with your other hand; } slide your arm in up to your sleeve; profit; }