Search.setIndex({"docnames": ["Advanced/closures", "Advanced/toctree", "ObjectOriented/Exercises", "ObjectOriented/inheritance", "ObjectOriented/javascript_classes", "ObjectOriented/toctree", "TheBasics/Exercises", "TheBasics/JS4Python", "TheBasics/collections", "TheBasics/conditionals", "TheBasics/datatypes", "TheBasics/loops", "TheBasics/pretest", "TheBasics/toctree", "Web/Exercises", "Web/dom_manipulation", "Web/javascript_web", "Web/toctree", "colophon", "index", "jsquiz1", "preface"], "filenames": ["Advanced/closures.rst", "Advanced/toctree.rst", "ObjectOriented/Exercises.rst", "ObjectOriented/inheritance.rst", "ObjectOriented/javascript_classes.rst", "ObjectOriented/toctree.rst", "TheBasics/Exercises.rst", "TheBasics/JS4Python.rst", "TheBasics/collections.rst", "TheBasics/conditionals.rst", "TheBasics/datatypes.rst", "TheBasics/loops.rst", "TheBasics/pretest.rst", "TheBasics/toctree.rst", "Web/Exercises.rst", "Web/dom_manipulation.rst", "Web/javascript_web.rst", "Web/toctree.rst", "colophon.rst", "index.rst", "jsquiz1.rst", "preface.rst"], "titles": ["4.1. More about Functions: Closures and Scopes", "4. Part III: Advanced Topics", "3.3. Exercises", "3.2. Inheritance", "3.1. Defining Classes in Javascript", "3. Part II: Object Oriented Programming", "2.8. Exercises", "2.2. Introduction", "2.7. Collections", "2.4. Conditionals", "2.6. JavaScript Data Types", "2.5. Loops and Iteration", "2.1. JavaScript PreTest", "2. Part I: The Basics", "5.3. Exercises", "5.2. Accessing and Modifying the DOM", "5.1. The Document Object Model", "5. Part III: Web Programming", "Colophon", "JavaScript for Python Programmers", "JavaScript Quiz 1", "1. Preface"], "terms": {"befor": [0, 4, 7, 16], "you": [0, 3, 4, 7, 8, 9, 10, 11, 12, 15, 16, 18, 20, 21], "read": [0, 7, 8, 10, 16], "thi": [0, 3, 4, 7, 8, 9, 10, 11, 12, 15, 16, 18, 20, 21], "section": [0, 4, 8, 10, 11, 15, 16], "answer": 0, "follow": [0, 6, 7, 8, 9, 10, 11, 12, 15, 16, 20], "question": [0, 4, 16, 20], "If": [0, 4, 7, 8, 9, 10, 11, 15, 18, 21], "ar": [0, 2, 4, 7, 8, 9, 10, 15, 16, 18, 20, 21], "new": [0, 3, 4, 7, 8, 10, 11, 16, 17, 18, 20], "javascript": [0, 3, 5, 6, 8, 9, 11, 15, 16, 21], "program": [0, 4, 8, 9, 10, 13, 16, 18, 19, 21], "gener": [0, 4, 15, 18], "mai": [0, 3, 4, 7, 8, 10, 16, 20, 21], "supris": 0, "q": [0, 10], "1": [0, 4, 7, 8, 10, 11, 12, 16], "what": [0, 4, 7, 8, 10, 12, 16, 20, 21], "print": [0, 4, 7, 8, 9, 10, 11, 15], "var": [0, 10, 11, 12, 20], "v": 0, "fun1": 0, "consol": [0, 7, 12, 20], "log": [0, 12, 20], "fun2": 0, "2": [0, 7, 8, 10, 11, 12, 16, 20], "correct": [0, 10, 12, 20], "No": 0, "valu": [0, 4, 7, 8, 10, 11, 16], "i": [0, 2, 3, 4, 6, 8, 9, 10, 11, 12, 15, 16, 18, 19, 20, 21], "obtain": 0, "from": [0, 2, 3, 4, 6, 7, 8, 9, 10, 16, 18, 20], "3": [0, 7, 8, 10, 11, 12, 20, 21], "now": [0, 4, 7, 8, 10, 15, 16], "think": [0, 7, 10, 11, 20, 21], "re": 0, "just": [0, 4, 7, 8, 10, 11, 15, 16, 18], "messin": 0, "me": [0, 10, 12, 16, 18, 20], "It": [0, 7, 12, 20], "an": [0, 2, 4, 6, 8, 9, 10, 11, 12, 15, 16, 18, 21], "error": [0, 4, 7, 8, 10], "The": [0, 3, 4, 6, 7, 8, 9, 10, 11, 12, 15, 17, 18, 19, 20, 21], "code": [0, 3, 4, 7, 8, 10, 11, 20], "run": [0, 7, 8, 10], "without": [0, 7, 16], "do": [0, 3, 4, 7, 8, 9, 10, 11, 12, 15, 16, 20, 21], "call": [0, 7, 8, 10, 11, 12, 16, 18, 20], "inner1": 0, "out": [0, 8, 9, 10, 15, 16], "z": [0, 20], "contain": [0, 6, 10, 12, 15, 16], "let": [0, 4, 8, 10, 11, 13, 15, 16, 20], "x": [0, 7, 10, 20], "y": [0, 20], "4": [0, 8, 10, 12, 20], "9": [0, 7, 8, 9, 10, 11, 12, 20], "inner2": 0, "return": [0, 2, 4, 6, 7, 8, 10, 12, 15, 16, 20], "captur": 0, "refer": [0, 4, 7, 10, 11, 16, 20, 21], "so": [0, 3, 4, 7, 8, 10, 11, 15, 16, 18, 20], "when": [0, 4, 7, 8, 10, 12, 16, 18], "reassign": 0, "7": [0, 8, 11, 12, 20], "close": [0, 8, 20], "sinc": [0, 8, 9, 10, 15, 16, 18], "first": [0, 4, 6, 7, 8, 9, 10, 15, 16, 20], "occur": [0, 8, 10, 12], "all": [0, 4, 6, 7, 8, 10, 15, 16, 18], "legal": [0, 7], "consid": 0, "final": [0, 8, 12, 18], "doubl": 0, "parent": [0, 4], "10": [0, 6, 7, 8, 10, 11, 12, 20], "squar": 0, "20": 0, "chang": [0, 4, 7, 8, 10, 12, 16, 20, 21], "made": [0, 4, 7], "perman": 0, "becaus": [0, 7, 9, 11, 16], "400": 0, "after": [0, 10, 18], "time": [0, 4, 7, 8, 10, 11, 12, 20], "definit": [0, 4, 8, 10, 13], "over": [0, 8, 10, 11], "800": 0, "veri": [0, 4, 7, 8, 9, 10, 11, 16], "good": [0, 7, 16, 21], "must": [0, 7, 12, 16], "realli": [0, 7, 8, 11, 18], "understand": [0, 4, 7, 8, 13, 15, 16], "can": [0, 4, 7, 8, 9, 10, 11, 15, 16], "math": [0, 7], "chanc": 0, "seem": [0, 16], "bit": [0, 7, 8, 15], "funni": 0, "start": [0, 7, 8, 10, 11, 12, 18, 20, 21], "begin": [0, 4, 7, 8, 10, 11], "try": [0, 7, 8, 10, 15, 16], "make": [0, 3, 4, 7, 8, 10, 16, 18, 21], "sens": [0, 18], "happen": [0, 8, 16], "defin": [0, 3, 5, 7, 8, 9, 10, 15, 19], "two": [0, 2, 4, 8, 10, 16, 18, 20, 21], "import": [0, 4, 7, 8, 16], "term": 0, "In": [0, 3, 4, 7, 8, 9, 10, 11, 15, 16, 18, 21], "variabl": [0, 4, 7, 8, 9, 11, 12, 13, 16, 20], "bind": 0, "name": [0, 3, 4, 7, 10, 12, 15, 16], "object": [0, 3, 4, 7, 10, 13, 15, 17, 19], "region": 0, "comput": [0, 7, 10, 21], "where": [0, 7, 8, 10, 16], "valid": [0, 10], "henc": [0, 10], "global": [0, 10], "avail": [0, 7, 18, 21], "everywher": 0, "own": [0, 7, 10, 18, 21], "window": [0, 7], "ha": [0, 4, 7, 8, 10, 16, 20], "both": [0, 7, 8, 9, 10, 11], "well": [0, 4, 8, 10, 18], "block": [0, 7, 9, 10, 20], "To": [0, 7, 8, 9, 10, 11], "differ": [0, 3, 4, 7, 8, 10, 11, 15, 16, 21], "exampl": [0, 3, 7, 8, 9, 10, 11, 15, 16, 21], "write": [0, 2, 4, 6, 7, 8, 9, 10, 11, 12, 15, 18, 20], "anywher": [0, 7, 10], "browser": [0, 7, 8, 16], "ani": [0, 4, 7, 8, 10, 11, 12, 16, 20, 21], "file": [0, 7, 8, 12], "script": [0, 12], "tag": [0, 12, 15, 16], "includ": [0, 7, 8, 10], "page": [0, 7, 10, 15, 16, 19, 20], "result": [0, 7, 8, 10, 16], "local": [0, 10], "onli": [0, 3, 4, 7, 8, 9, 10, 15, 16], "allow": [0, 4, 8, 10, 16], "bodi": [0, 7, 16], "have": [0, 4, 7, 8, 9, 10, 11, 12, 15, 16, 20, 21], "loop": [0, 7, 8, 10, 12, 13, 19], "open": [0, 8], "curli": [0, 7, 9, 10, 11], "brace": [0, 7, 9, 10, 11], "level": [0, 4, 10], "we": [0, 3, 4, 7, 8, 9, 10, 11, 12, 15, 16, 18, 21], "declar": [0, 7, 8, 12, 13, 20], "us": [0, 3, 4, 7, 8, 9, 10, 11, 15, 16, 18, 20, 21], "rather": [0, 7, 9, 11, 16], "than": [0, 7, 8, 9, 10, 11, 16], "As": [0, 7, 8, 10], "see": [0, 3, 7, 8, 9, 10, 11, 15, 20, 21], "come": [0, 4, 7], "go": [0, 4, 7, 8, 16], "execut": [0, 7, 9, 11], "lifetim": 0, "long": [0, 7], "take": [0, 2, 6, 8, 9, 10, 12, 16, 20], "similarli": 0, "exist": [0, 8, 10, 16], "while": [0, 4, 8, 11, 12, 20], "sometim": [0, 7, 8], "also": [0, 3, 7, 8, 9, 10, 11, 12, 16, 18], "lexic": 0, "similar": [0, 7, 8, 9, 10, 11], "structur": [0, 16, 18], "sourc": [0, 8, 16, 18, 21], "distinct": 0, "keep": 0, "mind": 0, "creat": [0, 4, 7, 8, 10, 12, 17], "wai": [0, 2, 3, 4, 7, 8, 9, 10, 11, 12, 16, 21], "environ": [0, 7], "which": [0, 4, 7, 8, 10, 12, 15], "like": [0, 3, 4, 7, 8, 9, 10, 15, 18], "real": [0, 10], "subtl": [0, 10], "har": 0, "incred": 0, "amount": 0, "power": [0, 7, 8, 9, 10], "look": [0, 4, 8, 10, 12, 13, 15, 16], "simpl": [0, 7, 8, 13], "counter_mak": 0, "initi": [0, 8, 16], "load": 0, "howev": [0, 4, 7, 10, 16], "counter1": 0, "counter2": 0, "until": [0, 4, 7, 10], "line": [0, 4, 7, 8, 10], "each": [0, 4, 7, 8, 9, 10, 11], "get": [0, 7, 8, 9, 10, 11, 15, 16, 18], "been": [0, 7, 10, 20], "0": [0, 4, 6, 7, 8, 10, 11, 20, 21], "perspect": 0, "its": [0, 4, 7, 10, 11, 16], "found": [0, 3, 4, 8, 10], "search": [0, 17, 19], "outward": 0, "next": [0, 7, 8, 9, 10], "find": [0, 7, 10, 15, 16, 21], "explain": 0, "were": 0, "judg": 0, "court": 0, "abov": [0, 8, 10, 11], "would": [0, 4, 7, 8, 9, 10, 11, 16, 18, 21], "compel": 0, "evid": [0, 18], "versu": 0, "f1": 0, "enclos": [0, 9], "But": [0, 4, 7, 8, 10, 16], "doesn": 0, "t": [0, 7, 8, 10, 11, 12, 16], "demonstr": [0, 10, 12, 20], "web": [0, 7, 10, 16, 19], "programm": [0, 4, 8, 10, 11, 21], "order": [0, 10, 21], "callback": 0, "nice": [0, 7, 15], "right": [0, 7, 10, 16, 20], "statement": [0, 4, 7, 8, 9, 10, 12, 16], "b": [0, 7, 9, 10, 12, 20], "onclick": 0, "set": [0, 3, 7, 16], "up": [0, 3, 4, 10], "counter": [0, 8], "rememb": [0, 7, 20], "bp": 0, "strictli": 0, "speak": [0, 3], "innerhtml": [0, 15, 16], "insid": [0, 7, 8, 10, 11, 12], "could": [0, 7, 8, 10, 16], "newli": 0, "button": [0, 7, 16], "lot": [0, 7, 8, 10, 11, 15], "clearer": 0, "remov": [0, 6, 8, 10, 16], "doubt": 0, "better": [0, 4], "add": [0, 4, 8, 10, 11, 15, 16], "second": [0, 6, 7, 9, 10, 16, 18], "third": [0, 7, 8], "buttonmak": 0, "buttondiv": 0, "three": [0, 8, 9, 10, 11], "Not": 0, "preserv": 0, "suppos": [0, 8, 15, 16], "work": [0, 3, 7, 8, 10, 16, 21], "modifi": [0, 16, 17, 19, 21], "sure": 0, "uniqu": [0, 7, 15], "id": [0, 12, 15, 16, 20], "should": [0, 2, 4, 6, 7, 10, 12, 16, 20], "button_1": 0, "button_2": 0, "etc": 0, "addit": [0, 3, 4, 7, 8, 10, 11, 21], "itself": 0, "end": [0, 7, 8, 10, 11, 12], "div": [0, 2], "show": [0, 4, 8, 10], "wa": [0, 4, 7, 8, 9, 18], "press": [0, 7], "append": [0, 8], "record": 0, "more": [1, 3, 4, 7, 8, 10, 11, 15, 16, 18, 19], "about": [1, 4, 7, 8, 10, 12, 16, 19, 20, 21], "function": [1, 3, 5, 6, 7, 8, 9, 10, 11, 12, 16, 19, 20], "closur": [1, 19], "scope": [1, 8, 10, 19, 20], "equal": [2, 9, 16], "method": [2, 5, 7, 8, 10, 15, 16, 20], "fraction": [2, 4], "class": [2, 5, 7, 15, 18, 19, 20, 21], "true": [2, 6, 7, 9, 10, 12], "fals": [2, 6, 7, 9, 10, 12], "otherwis": [2, 8, 12], "sub": 2, "mul": 2, "repres": [2, 7, 8, 10], "rectangl": [2, 20], "your": [2, 4, 7, 8, 13, 15, 16, 20, 21], "constructor": [2, 20], "length": [2, 10, 20], "width": [2, 20], "area": [2, 20], "old": [2, 4, 10, 16], "stack": 2, "implement": [2, 3, 4, 7, 10, 21], "data": [2, 4, 7, 8, 11, 13, 16, 18, 19], "type": [2, 4, 7, 8, 13, 19], "push": [2, 8, 18], "pop": [2, 8, 10], "peek": 2, "size": [2, 8], "isempti": 2, "queue": 2, "enqueu": 2, "dequeu": 2, "cat": 2, "inherit": [2, 4, 5, 19], "anim": [2, 3], "support": [3, 7, 8, 9, 10, 11, 16], "here": [3, 4, 8, 9, 10, 16, 18, 20], "common": [3, 4, 7, 8, 10, 16, 21], "python": [3, 4, 7, 8, 9, 10, 11, 18, 21], "syntax": [3, 4, 7, 8, 10, 11, 12, 20], "extend": 3, "keyword": 3, "below": [3, 10, 12, 15, 16, 20], "older": 3, "someth": [3, 7, 8, 9, 10, 16], "dog": 3, "_name": 3, "prototyp": [3, 4, 7], "writeln": [3, 7, 10, 11], "woof": 3, "assignign": 3, "attribut": [3, 8, 15, 16, 21], "chain": [3, 4], "explicitli": [3, 10], "some": [3, 4, 7, 8, 10, 11, 15, 18, 20], "explicit": [3, 10, 11], "respect": 3, "how": [3, 4, 7, 8, 12, 15, 16, 20], "expens": 3, "being": [3, 7, 10], "verbos": 3, "most": [3, 4, 7, 8], "other": [3, 4, 7, 8, 16, 18, 20], "languag": [3, 4, 8, 10, 13, 16, 18, 19, 21], "quit": [4, 7, 10], "mysteri": 4, "beginn": 4, "There": [4, 7, 10, 15], "fact": [4, 7, 8, 10, 16], "technial": 4, "did": [4, 10], "idea": [4, 7, 10, 15], "factori": 4, "form": 4, "orient": [4, 16, 19], "reus": 4, "one": [4, 7, 8, 10, 11, 15, 16, 18, 20, 21], "mainstream": 4, "almost": [4, 7], "classic": 4, "multipl": 4, "instanti": 4, "same": [4, 7, 8, 9, 11, 12, 15], "place": [4, 7], "describ": 4, "sever": [4, 7, 8, 10, 15, 16], "organ": 4, "hierarchi": 4, "further": [4, 10], "store": [4, 8], "higher": 4, "lower": [4, 10], "mean": [4, 10], "share": 4, "directli": [4, 16], "busi": 4, "goe": 4, "awai": [4, 9, 18], "want": [4, 7, 8, 10, 11, 15, 16, 18], "still": [4, 7, 21], "valuabl": 4, "thing": [4, 7, 8, 10, 12, 15, 16], "link": 4, "togeth": [4, 8, 10], "everi": [4, 8, 10], "secret": 4, "ask": [4, 16], "properti": 4, "doe": [4, 7, 8, 9, 10, 12, 16, 18, 21], "continu": [4, 7], "root": 4, "reach": [4, 7], "http": [4, 21], "stackoverflow": 4, "com": 4, "186244": 4, "base": [4, 10], "difficult": 4, "develop": [4, 7], "latest": [4, 7, 10], "version": [4, 7, 8, 10, 18], "under": [4, 9, 21], "cover": [4, 12, 20], "syntact": [4, 18], "sugar": 4, "life": 4, "u": [4, 7, 8, 10, 16], "explor": [4, 10], "given": [4, 6, 10, 15, 16], "numer": [4, 10], "denomin": 4, "simplifi": 4, "ad": [4, 16], "subtract": 4, "multipli": 4, "divid": 4, "compar": [4, 9], "A": [4, 7, 8, 9, 10, 20], "integ": [4, 6, 8, 9, 10, 11], "list": [4, 10, 11, 13, 15], "sortabl": 4, "default": [4, 8], "sort": 4, "mostli": 4, "complet": 4, "throughout": 4, "def": [4, 6, 7], "__init__": 4, "self": 4, "top": 4, "bottom": 4, "num": [4, 6], "den": 4, "__repr__": 4, "retwhol": 4, "retnum": 4, "str": [4, 10], "els": [4, 7, 10, 13, 18], "__add__": 4, "otherfract": 4, "convert": [4, 8, 10, 18], "tofract": 4, "newnum": 4, "newden": 4, "gcd": 4, "__radd__": 4, "leftnum": 4, "__cmp__": 4, "num1": 4, "num2": 4, "n": [4, 10], "isinst": 4, "int": [4, 10], "elif": [4, 13], "float": [4, 10], "wholepart": 4, "fracpart": 4, "100th": 4, "fracnum": 4, "100": [4, 10, 11, 15, 20], "cannot": [4, 8, 20], "none": 4, "helper": 4, "m": 4, "oldm": 4, "oldn": 4, "instanc": 4, "need": [4, 7, 8, 9, 10, 16], "our": [4, 7, 8, 10, 16, 18], "Of": [4, 7, 8, 16], "cours": [4, 7, 8, 16], "simpli": [4, 8, 9], "assign": [4, 7, 10, 11, 16, 19], "objectreferenc": 4, "variablenam": 4, "prior": [4, 10, 11], "recent": 4, "Its": [4, 15], "too": [4, 7, 10, 11, 16], "billion": 4, "written": [4, 7, 9, 11, 21], "major": [4, 7], "between": [4, 7, 8, 10, 16, 21], "special": [4, 7, 16], "comparison": [4, 7], "effect": 4, "redefin": 4, "standard": [4, 7, 10], "oper": [4, 8, 10, 13, 16], "behav": 4, "overload": [4, 10], "divis": 4, "easi": [4, 7, 8, 9], "clean": 4, "feel": [4, 18, 21], "littl": [4, 7, 8], "strang": 4, "word": [4, 8, 16], "front": [4, 7, 8, 10], "current": [4, 7], "notic": [4, 16], "NOT": 4, "suppli": 4, "paramet": [4, 6, 10, 12, 16], "member": 5, "exercis": [5, 13, 17, 19], "translat": 6, "sumlist": 6, "l": [6, 8, 11, 12, 20], "total": [6, 8, 10], "accept": [6, 8], "arrai": [6, 7, 10, 11, 12, 13, 15], "number": [6, 8, 10, 12], "largest": 6, "construct": [6, 7, 8, 10, 11, 16], "prime": 6, "occurr": [6, 10], "letter": 6, "string": [6, 7, 8, 11, 13], "revers": 6, "argument": [6, 7, 20], "digit": 6, "recogn": 6, "palindrom": 6, "book": [7, 10, 18, 20, 21], "assum": [7, 10], "alreadi": [7, 11, 12], "familiar": [7, 8], "point": [7, 10, 12], "journei": 7, "main": [7, 16], "user": [7, 10, 12], "input": [7, 13], "condit": [7, 8, 10, 11, 13, 19], "onc": [7, 8, 9, 10, 20], "basic": [7, 19], "behind": 7, "move": [7, 8, 10, 16], "featur": [7, 16], "": [7, 10, 18], "built": 7, "regex": 7, "date": 7, "json": 7, "pleas": [7, 18, 21], "note": [7, 8, 10], "progress": 7, "updat": [7, 8], "post": 7, "reason": [7, 16, 18], "spars": 7, "clear": [7, 11, 16, 18], "underli": 7, "model": [7, 9, 17, 19], "consist": 7, "interest": [7, 8, 10], "kind": [7, 8, 10, 15, 20], "dynam": [7, 10], "might": [7, 8, 15, 16], "fairli": 7, "inform": [7, 18], "java": [7, 12], "c": [7, 11, 12, 18, 20], "formal": 7, "arguabl": 7, "popular": 7, "todai": 7, "These": [7, 8, 10, 15], "advantag": [7, 9], "speed": 7, "larg": [7, 8], "give": [7, 8, 11, 16], "best": [7, 10, 15], "perform": 7, "maintain": 7, "certain": [7, 9], "For": [7, 8, 9, 10, 11, 15, 16], "turtl": 7, "forget": [7, 9], "later": [7, 8, 10], "invok": 7, "protect": 7, "forc": 7, "upfront": 7, "invent": 7, "1995": 7, "brendan": 7, "eich": 7, "specif": [7, 15, 16], "origin": [7, 10, 11], "hire": 7, "netscap": 7, "bring": [7, 10], "scheme": 7, "deem": 7, "practic": [7, 10], "mocha": 7, "dai": [7, 10], "releas": 7, "unchang": 7, "livescript": 7, "renam": 7, "live": 7, "mani": [7, 8, 10, 15, 16, 21], "decis": 7, "dure": 7, "session": 7, "control": [7, 11], "ecma": 7, "intern": 7, "variou": [7, 8, 16], "vendor": 7, "provid": [7, 8, 10, 11, 12, 18], "known": 7, "ecmascript": [7, 8, 10], "alwai": 7, "field": 7, "scienc": [7, 8, 21], "them": [7, 8, 10, 15, 18, 20], "know": [7, 8, 12, 16, 21], "expect": [7, 16, 20], "And": 7, "honor": [7, 20], "tradit": 7, "hello": [7, 11, 15], "world": [7, 11, 15], "logic": 7, "reli": 7, "complic": 7, "command": 7, "wait": 7, "minut": 7, "wonder": [7, 16], "don": [7, 8, 12, 16], "output": [7, 8, 10, 12, 20], "box": [7, 10], "highlight": 7, "design": [7, 10], "usual": [7, 10], "associ": 7, "mac": 7, "option": [7, 11], "trick": 7, "On": [7, 16], "ctrl": 7, "shift": [7, 8], "j": 7, "Or": 7, "hunt": 7, "around": [7, 9], "menu": 7, "system": 7, "With": [7, 10], "certainli": 7, "possibl": [7, 10], "put": [7, 8, 9, 12], "pretti": [7, 8, 10], "much": [7, 8, 10, 12], "earli": [7, 8], "tackl": 7, "problem": [7, 8, 18], "either": [7, 8], "alert": [7, 10], "handi": 7, "act": [7, 8, 9, 10, 15], "bunch": 7, "scene": 7, "grai": 7, "nod": 7, "ancient": 7, "pascal": 7, "send": 7, "printer": 7, "annoi": 7, "core": 7, "few": [7, 8, 10, 15, 16], "unlik": [7, 8], "regardless": 7, "whether": [7, 10], "hoist": [7, 10], "case": [7, 8, 9, 10, 16], "back": [7, 16], "fundament": [7, 8], "whitespac": [7, 10], "indent": [7, 9], "denot": 7, "swift": 7, "charact": [7, 8, 10, 11], "signific": [7, 16], "signifi": 7, "spread": 7, "across": 7, "compil": 7, "encount": 7, "equival": [7, 8, 10], "encourag": [7, 21], "semicolon": 7, "obviou": [7, 10], "habit": 7, "avoid": [7, 11], "accident": 7, "notat": [7, 8], "context": [7, 10, 18], "wast": [7, 12], "fly": 7, "arrow": [7, 8], "lambda": [7, 8], "immedi": 7, "appreci": [7, 21], "param1": 7, "param2": 7, "express": [7, 8, 10], "compact": 7, "ve": 7, "never": 7, "worri": [7, 16], "ll": [7, 10], "revisit": 7, "compound": 7, "taught": 7, "often": [7, 8, 9], "introductori": 7, "peopl": [7, 12], "reduc": [7, 8], "readabl": [7, 8], "nearli": 7, "convolut": 7, "confus": [7, 8, 10], "truevalu": 7, "falsevalu": 7, "test": [7, 8, 10], "previou": [7, 16], "check": [7, 13, 15], "depend": 7, "accomplish": 7, "regular": 7, "conveni": [7, 8], "singl": [7, 9, 10, 12, 15], "resist": 7, "shortcut": 7, "primit": [8, 10], "preliminari": 8, "everyth": [8, 10, 16, 18], "capabl": 8, "myobj": 8, "someattribut": 8, "somevalu": 8, "One": 8, "although": 8, "index": [8, 10, 11, 19], "slice": [8, 10], "iter": [8, 10, 13, 19], "item": 8, "ones": 8, "newitem": 8, "off": 8, "insert": [8, 10], "unshift": 8, "idx": 8, "splice": 8, "delet": 8, "del": 8, "l1": 8, "l2": 8, "concat": [8, 10], "last": [8, 11, 15, 20], "requir": [8, 9], "explan": 8, "won": 8, "instead": 8, "silent": 8, "evilli": 8, "concaten": [8, 10], "23": 8, "yike": 8, "neg": [8, 10], "undefin": [8, 13], "through": [8, 10, 20], "inclus": 8, "5": [8, 10, 11, 12, 20], "offset": 8, "mylist": [8, 10], "coupl": [8, 9, 11, 20], "hold": 8, "tempt": 8, "mislead": 8, "kei": [8, 10, 16], "throw": 8, "sai": [8, 10], "foo": [8, 20], "pattern": [8, 9, 10], "part": [8, 19, 21], "split": [8, 10], "element": [8, 11, 12, 15, 16, 20], "anoth": [8, 10, 13, 16, 19], "produc": 8, "histogram": 8, "frequenc": 8, "6": [8, 10, 12, 20], "8": [8, 11, 12, 20], "review": 8, "posit": [8, 10], "dat": 8, "increment": 8, "indic": [8, 10], "introduc": [8, 10, 16, 18], "concept": [8, 10], "arraylist": 8, "boolean": [8, 13], "exit": [8, 10], "sequenc": [8, 10, 11], "xxx": 8, "rang": [8, 11], "except": [8, 10, 11, 15], "exact": [8, 16], "count": [8, 11, 12], "assumpt": 8, "fill": 8, "parseint": 8, "const": [8, 10], "ensur": [8, 10, 11], "attempt": [8, 21], "caus": [8, 10, 20], "limit": 8, "11": [8, 10, 11, 12], "13": [8, 11, 12], "count8": 8, "idiom": [8, 10], "map": [8, 10], "liner": 8, "appli": 8, "transform": 8, "tool": 8, "worth": [8, 15], "detail": [8, 10], "paradigm": 8, "wide": [8, 11], "dataset": 8, "task": 8, "access": [8, 10, 16, 17, 19], "pair": 8, "mechan": 8, "dot": [8, 10, 16], "retriev": 8, "space": [8, 18], "dash": 8, "middl": 8, "mydict": 8, "effort": 8, "approach": [8, 16], "essenti": 8, "fat": 8, "val": 8, "cleaner": 8, "simpler": 8, "seen": [8, 10, 11], "side": [8, 16], "tupl": [8, 11], "commonli": 8, "mydict8": 8, "nobodyhom": 8, "evalu": [8, 9, 10, 11, 16], "falsei": [8, 10], "full": 8, "blown": 8, "stai": 8, "document": [8, 15, 17, 18, 19], "job": [8, 18], "modern": 8, "chapter": [8, 16], "suffic": 8, "text": [8, 10, 15, 16, 18], "paragraph": [8, 16], "alic": 8, "mock": 8, "improv": 8, "punctuat": 8, "statement1": [9, 11], "statement2": [9, 11], "again": [9, 10], "parenthesi": [9, 11], "technic": [9, 16], "nest": [9, 10], "even": [9, 10, 12], "closer": 9, "rule": 9, "grade": [9, 12], "recommend": 9, "enumer": 9, "constant": 9, "break": 9, "left": [9, 16], "altern": 9, "automat": [9, 10], "95": 9, "omit": 9, "five": 10, "symbol": 10, "outsid": 10, "belong": 10, "therefor": 10, "within": 10, "carefulli": 10, "realiz": 10, "redund": 10, "introduct": [10, 13, 19], "hurt": 10, "themselv": 10, "year": 10, "had": [10, 16, 21], "actual": 10, "thankfulli": 10, "those": [10, 21], "advic": 10, "stop": [10, 11], "interpret": [10, 16, 20], "figur": 10, "determin": 10, "undeclar": 10, "style": [10, 15, 16], "fahr": 10, "ratio": 10, "shortli": 10, "fine": 10, "mention": 10, "unintend": 10, "consequ": 10, "spent": 10, "week": 10, "track": 10, "down": [10, 12], "lazi": 10, "help": [10, 21], "catch": 10, "creation": 10, "strict": [10, 20], "mode": 10, "ago": 10, "enabl": 10, "yourself": [10, 21], "prompt": 10, "dialog": 10, "fancier": 10, "interfac": 10, "leav": [10, 20], "necessari": 10, "calcul": 10, "wherea": 10, "differenti": 10, "infinit": 10, "precis": 10, "modul": [10, 19], "2676506002282294e": 10, "30": 10, "1267650600228229401496703205376": 10, "truthi": 10, "vice": 10, "versa": 10, "empti": 10, "dictionari": [10, 13], "nan": 10, "f": 10, "especi": 10, "absenc": 10, "immut": 10, "manipul": 10, "That": [10, 16], "pull": 10, "substr": 10, "big": [10, 18], "tabl": 10, "counterpart": 10, "shown": 10, "zero": 10, "descript": 10, "charat": 10, "3rd": 10, "2nd": 10, "4th": 10, "len": 10, "indexof": 10, "strip": 10, "trim": 10, "replac": [10, 16, 21], "illustr": [10, 16], "vowel": 10, "accumul": 10, "ignor": 10, "pass": 10, "present": 10, "clearli": 10, "variat": [10, 11], "eachchar": 10, "char": 10, "restrict": 10, "anymor": 10, "welcom": [10, 21], "tripl": 10, "quot": [10, 16], "pain": 10, "who": [10, 21], "templat": 10, "chunk": 10, "backquot": 10, "newlin": 10, "thei": [10, 18], "modulu": 10, "d": [10, 11], "liter": 10, "emb": 10, "closest": 10, "delimit": 10, "delai": 10, "sum": [10, 11, 20], "serv": 11, "easiest": 11, "conjunct": 11, "recal": 11, "varieti": 11, "step": 11, "analog": 11, "claus": 11, "backward": 11, "21": 11, "fib": 11, "foreach": 11, "seldom": 11, "least": 11, "prefer": 11, "situat": 11, "quiz": 12, "assess": [12, 20], "toward": 12, "nor": 12, "basi": 12, "measur": 12, "learn": [12, 13, 16, 19, 20, 21], "html": [12, 15, 16, 18, 20], "content": [12, 16, 20], "p": [12, 15, 20], "demo": [12, 20], "extern": 12, "myfunct": 12, "IF": 12, "FOR": 12, "event": 12, "click": [12, 16], "12": 12, "14": 12, "iseven": 12, "pretest": [13, 19, 20], "why": [13, 16, 19], "switch": [13, 18], "indefinit": 13, "convers": 13, "null": 13, "collect": [13, 19], "queryselector": [15, 16], "getelementsbytagnam": 15, "getelementsbynam": 15, "match": 15, "getelementsbyclass": 15, "getelementbyid": 15, "htmlcollect": 15, "guarante": 15, "fix": 15, "longer": 15, "duplic": 15, "expand": 15, "comprehens": 15, "w3school": 15, "children": 15, "firstchild": 15, "lastchild": 15, "classnam": 15, "classlist": 15, "textcont": 15, "nextsibl": 15, "nodenam": 15, "tagnam": 15, "parentel": 15, "tostr": 15, "somewher": 15, "mysteryid": 15, "li": 15, "createel": 15, "createattribut": 15, "appendchild": 15, "insertbefor": 15, "specialclass": 15, "h2": 15, "receiv": 16, "tree": [16, 17], "represent": 16, "unstructur": 16, "heirarch": 16, "representaiton": 16, "dom": [16, 17, 19], "critic": 16, "abl": 16, "guess": 16, "entir": 16, "oo": 16, "height": 16, "tell": 16, "pixel": 16, "high": 16, "backgroundcolor": 16, "backgroudcolor": 16, "background": 16, "color": 16, "hand": 16, "lightblu": 16, "preceed": 16, "relationship": 16, "sign": 16, "wipe": 16, "whatev": 16, "small": 16, "portion": 16, "webpag": 16, "goal": 16, "h1": 16, "rest": 16, "identifi": 16, "handl": 16, "IN": 16, "semant": 16, "grown": 16, "assgin": 16, "statemetnt": 16, "mymain": 16, "far": [16, 18], "fanci": 16, "attach": 16, "abstract": 16, "selector": 16, "css": 16, "head": 16, "breather": 16, "view": 16, "node": 17, "graft": 17, "articl": 18, "2006": 18, "restructur": 18, "2007": 18, "markdown": 18, "particular": 18, "variant": 18, "excel": 18, "pandoc": 18, "latex": 18, "pdf": 18, "format": 18, "becam": 18, "prepar": 18, "htlatex": 18, "onlin": 18, "got": 18, "At": 18, "luther": [18, 20, 21], "colleg": [18, 20], "cs1": 18, "cs2": 18, "decid": 18, "student": [18, 21], "semest": [18, 21], "comfort": 18, "brand": 18, "great": 18, "teach": [18, 21], "algorithm": 18, "clutter": 18, "david": 18, "ranum": 18, "wrote": 18, "solv": 18, "finish": 18, "fall": 18, "2008": 18, "jone": 18, "bartlett": 18, "publish": [18, 21], "tent": 18, "titl": 18, "free": [18, 21], "contact": 18, "prefac": 19, "ii": 19, "iii": 19, "advanc": 19, "topic": 19, "colophon": 19, "shameless": 19, "plug": 19, "repeat": 20, "diabol": 20, "internet": 20, "besid": 20, "copi": 20, "past": 20, "snippet": 20, "cheat": 20, "report": 20, "anyon": 20, "refresh": 20, "submit": 20, "done": 20, "jsquiz1": 20, "short": 21, "ebook": 21, "ongo": 21, "project": 21, "audienc": 21, "build": 21, "philosophi": 21, "along": 21, "examin": 21, "strength": 21, "weak": 21, "fit": 21, "resourc": 21, "creativ": 21, "licens": 21, "purpos": 21, "love": 21, "modif": 21, "github": 21, "brad": 21, "miller": 21, "bmiller": 21, "edu": 21, "januari": 21, "2016": 21, "unit": 21, "state": 21, "creativecommon": 21, "org": 21}, "objects": {}, "objtypes": {}, "objnames": {}, "titleterms": {"more": 0, "about": 0, "function": [0, 4], "closur": 0, "scope": 0, "part": [1, 5, 7, 13, 17], "iii": [1, 17], "advanc": [1, 7, 8], "topic": [1, 7, 8], "exercis": [2, 6, 14], "inherit": 3, "defin": 4, "class": 4, "javascript": [4, 7, 10, 12, 13, 19, 20], "method": 4, "member": 4, "ii": 5, "object": [5, 8, 16], "orient": 5, "program": [5, 7, 17], "oop": 5, "introduct": 7, "an": 7, "overview": 7, "i": [7, 13], "outlin": 7, "why": 7, "learn": 7, "anoth": 7, "languag": 7, "let": 7, "look": 7, "boolean": [7, 10], "oper": 7, "collect": 8, "list": 8, "arrai": 8, "listoper": 8, "listoperations1": 8, "check": [8, 10], "membership": 8, "dictionari": 8, "condit": 9, "simpl": [9, 10], "els": 9, "elif": 9, "switch": 9, "data": 10, "type": 10, "declar": 10, "variabl": 10, "input": 10, "convers": 10, "null": 10, "undefin": 10, "string": 10, "multilin": 10, "format": 10, "your": 10, "understand": 10, "loop": 11, "iter": 11, "definit": 11, "indefinit": 11, "pretest": 12, "The": [13, 16], "basic": 13, "access": 15, "modifi": 15, "dom": 15, "search": 15, "node": 15, "tree": 15, "creat": 15, "graft": 15, "new": 15, "document": 16, "model": 16, "web": 17, "colophon": 18, "shameless": 18, "plug": 18, "python": 19, "programm": 19, "back": 19, "matter": 19, "indic": 19, "tabl": 19, "quiz": 20, "1": 20, "prefac": 21}, "envversion": {"sphinx.domains.c": 2, "sphinx.domains.changeset": 1, "sphinx.domains.citation": 1, "sphinx.domains.cpp": 8, "sphinx.domains.index": 1, "sphinx.domains.javascript": 2, "sphinx.domains.math": 2, "sphinx.domains.python": 3, "sphinx.domains.rst": 2, "sphinx.domains.std": 2, "sphinx": 57}, "alltitles": {"More about Functions: Closures and Scopes": [[0, "more-about-functions-closures-and-scopes"]], "Part III: Advanced Topics": [[1, "part-iii-advanced-topics"]], "Advanced Topics": [[1, null]], "Exercises": [[2, "exercises"], [6, "exercises"], [14, "exercises"]], "Inheritance": [[3, "inheritance"]], "Defining Classes in Javascript": [[4, "defining-classes-in-javascript"]], "Methods or Member Functions": [[4, "methods-or-member-functions"]], "Part II: Object Oriented Programming": [[5, "part-ii-object-oriented-programming"]], "OOP": [[5, null]], "Introduction": [[7, "introduction"]], "An Overview of Part I": [[7, null]], "Topic Outline": [[7, "topic-outline"]], "Why Learn Another Programming Language?": [[7, "why-learn-another-programming-language"]], "Lets Look at a JavaScript Program": [[7, "lets-look-at-a-javascript-program"]], "Advanced Topic": [[7, null], [8, null]], "Boolean Operators": [[7, "boolean-operators"]], "Collections": [[8, "collections"]], "Lists/Arrays": [[8, "lists-arrays"]], "listoperations": [[8, "id3"]], "listoperations1": [[8, "id4"]], "Checking for membership": [[8, "checking-for-membership"]], "Dictionary/Object": [[8, "dictionary-object"]], "Conditionals": [[9, "conditionals"]], "Simple if": [[9, "simple-if"]], "if else": [[9, "if-else"]], "elif": [[9, "elif"]], "switch": [[9, "switch"]], "JavaScript Data Types": [[10, "javascript-data-types"]], "Declaring Variables": [[10, "declaring-variables"]], "Simple Input": [[10, "simple-input"]], "Type Conversion": [[10, "type-conversion"]], "Boolean": [[10, "boolean"]], "Null and Undefined": [[10, "null-and-undefined"]], "Strings": [[10, "strings"]], "Multiline Strings and Formatted Strings": [[10, "multiline-strings-and-formatted-strings"]], "Check Your Understanding": [[10, "check-your-understanding"]], "Loops and Iteration": [[11, "loops-and-iteration"]], "Definite Loop": [[11, "definite-loop"]], "Indefinite Loops": [[11, "indefinite-loops"]], "JavaScript PreTest": [[12, "javascript-pretest"]], "Part I: The Basics": [[13, "part-i-the-basics"]], "JavaScript Basics": [[13, null]], "Accessing and Modifying the DOM": [[15, "accessing-and-modifying-the-dom"]], "Searching for nodes in the tree": [[15, "searching-for-nodes-in-the-tree"]], "Creating and Grafting new Nodes into the tree": [[15, "creating-and-grafting-new-nodes-into-the-tree"]], "The Document Object Model": [[16, "the-document-object-model"]], "Part III: Web Programming": [[17, "part-iii-web-programming"]], "Web": [[17, null]], "Colophon": [[18, "colophon"]], "Shameless Plug": [[18, "shameless-plug"]], "JavaScript for Python Programmers": [[19, "javascript-for-python-programmers"]], "Back Matter": [[19, "back-matter"]], "Indices and tables": [[19, "indices-and-tables"]], "JavaScript Quiz 1": [[20, "javascript-quiz-1"]], "Preface": [[21, "preface"]]}, "indexentries": {}})