01:198:170 Lecture Notes - Lecture 15: Code Reuse
taupebee294 and 9 others unlocked
9
01:198:170 Full Course Notes
Verified Note
9 documents
Document Summary
Code reuse: saves you if there"s a mistake in the code; only need to change it once. Reduce complexity: can write multiple functions to solve a problem. Problem resolution: when you have separate functions & know what functions are doing, if program isn"t working, you can narrow in on function that"s not working problems = limited to different functions. Organization: allows you to keep thoughts organized. Function: must have header & de nition, function de nition is js statements to perform, function must have name & parameters (so that you could pass values to the function; collect data to execute function) Parameter: reception area for receiving data from call. You call a function to make it work (also use alert) Assignments & parameters must match 1 to 1. Remember to put semi-colons, matching curly braces, parentheses. Always make sure functions are put inside script tags or inside button quotes.