Long description

Back

A vertically oriented rectangle labeled Execution memory space is shown in the figure. A horizontally oriented rectangle labeled c 1 colon Card that represents an object is placed at the top of the execution memory space. c 1 colon Card shows the first set of code. Line 1: this dot title equals open double quotes Van Gogh close double quotes semicolon. Line 2: this dot s r c equals open double quotes 019170 dot j p g close double quotes semicolon. Line 3: this dot content equals open double quotes Self Portrait close double quotes. Line 1 to line 3 is labeled 80 bytes at the right. Line 4: this dot makeMarkup equals function open parenthesis close parenthesis open curly brace. Line 5: return open single quote ellipsis close single quote semicolon. Line 6: Close curly brace. Line 7: this dot makeElement equals function open parenthesis close parenthesis open curly brace. An arrow labeled In JavaScript, a function expression is an object whose content is the definition of the function ellipsis points at line 7 from the right. Line 8: StartCommand let EndCommand cardDiv equals document dot createElement open parenthesis open single quote div close single quote close parenthesis semicolon. Line 9: cardDiv dot setAttribute open parenthesis open single quote class close single quote comma open single quote card close single quote close parenthesis semicolon. Line 10: Ellipsis. Line 11: return cardDiv semicolon. Line 12: Close curly brace. Line 4 to line 12 is labeled 920 bytes at the right. A portrait of Van Gogh is placed at the top right end of c 1 colon Card.

A horizontally oriented rectangle labeled c 2 colon Card that represents an object is placed below the c 1 colon Card. Line 1: this dot title equals open double quotes Monet close double quotes semicolon. Line 2: this dot s r c equals open double quotes 017080 dot j p g close double quotes semicolon. Line 3: this dot content equals open double quotes The Bridge at ellipsis close double quotes. Lines 1 to line 3 is labeled 80 bytes. Line 4: this dot makeMarkup equals function open parenthesis close parenthesis open curly brace. Line 5: return open single quote ellipsis close single quote semicolon. Line 6: Close curly brace. Line 7: this dot makeElement equals function open parenthesis close parenthesis open curly brace. Line 8: StartCommand let EndCommand cardDiv equals document dot createElement open parenthesis open single quote div close single quote close parenthesis semicolon. Line 9: cardDiv dot setAttribute open parenthesis open single quote class close single quote comma open single quote card close single quote close parenthesis semicolon. Line 10: Ellipsis. Line 11: return cardDiv semicolon. Line 12: Close curly brace. Line 4 to line 12 is labeled 920 bytes at the right. A painting by Monet labeled The Bridge at ellipsis is placed at the top right end of c 2 colon Card. Note: So each instance will contain that same content is written at the right of c 2 colon Card.

Three horizontally oriented rectangles that represent objects are placed overlapping each other at the left side, below c 2 colon Card. This is followed by ellipsis on the right. A horizontally oriented rectangle labeled c 100 colon Card that represents an object is placed below the three overlapping rectangles. Line 1: this dot title equals open double quotes Monet close double quotes semicolon. Line 2: this dot s r c equals open double quotes 017040 dot j p g close double quotes semicolon. Line 3: this dot content equals open double quotes Women with Parasol close double quotes. Lines 1 to line 3 is labeled 80 bytes. Line 4: this dot makeMarkup equals function open parenthesis close parenthesis open curly brace. Line 5: return open single quote ellipsis close single quote semicolon. Line 6: Close curly brace. Line 7: this dot makeElement equals function open parenthesis close parenthesis open curly brace. Line 8: StartCommand let EndCommand cardDiv equals document dot createElement open parenthesis open single quote div close single quote close parenthesis semicolon. Line 9: cardDiv dot setAttribute open parenthesis open single quote class close single quote comma open single quote card close single quote close parenthesis semicolon. Line 10: Ellipsis. Line 11: return cardDiv semicolon. Line 12: Close curly brace. Line 4 to line 12 is labeled 920 bytes at the right. A painting by Monet labeled Women with Parasol is placed at the top right end of c 100 colon Card. Note: which is incredibly memory inefficient when there are many instances of that object is written at the right of c 2 colon Card. Total Memory Used equals 1000 bytes open parenthesis 1 K close parenthesis for each card x 100 cards equals 100 k is written at the bottom of the vertically oriented rectangle.

Back