e fire alarm rang. It was a fire drill.</p><p id="09ee">The fire alarm rang, but it was a fire drill.</p><h1 id="bab4">Rule 2: Use commas to separate nouns of direct address</h1><p id="0e85">Note: A noun of direct address names the noun (person) to whom the speaker is speaking.</p><p id="bc01"><b>Examples:</b></p><p id="cac0">Come in, Steve, and close the door.</p><p id="1844">Steve, come in and close the door.</p><p id="0543">Come in and close the door, Steve.</p><h1 id="8001">Rule 3: Use commas to separate an appositive</h1><p id="37ad"><b>Note:</b> Appositive are words placed immediately after other words that carry the same meaning and add clarity.</p><p id="e223"><b>Example:</b></p><p id="301d">Mrs. Gross is in Florida<b>.</b></p><p id="77cd">Mrs. Gross, my aunt, is in Florida.</p><h1 id="7f0c">Rule 4: Use commas to set off words that interrupt the sentence</h1><p id="ea4e"><b>Example:</b></p><p id="92b3">The fabric is pre-shrunk.</p><p id="aa46">This fabric, on the other hand, is pre-shrunk.</p><h1 id="20b2">Rule 5: Use commas to separate introductory words or phrases from the base sentence</h1><p id="5fc6"><b>Examples:</b></p><p id="4422">Bill sat through the horror film.</p><p id="c704">Closing his eyes, Bill sat through the horror film.</p><p id="6a65">Yes, Bill sat through the horror film.</p><h1 id="7331">Rule 6: Use commas after every item in a list except the last</h1><p id="a933"><b>Note:</b> Follow this rule with nouns and verbs.</p><p id="f3e7"><b>Examples:</b></p><p id="6d66">Sam, Susan, Steve and Scott went home. (nouns)</p><p id="e5f6">The dog barked, jumped and rolled over. (verbs)</p><h1 id="ca7b">Rule 7: Use commas to separate two or more adjectives that describe a noun</h1><p id="1c90"><b>Note:</b> Adjectives are descriptive words.</p><p id="b208"><b>Example:</b></p><p
Options
id="6230">The bright, yellow sun illuminated the sky.</p><h1 id="3306">Rule 8: Use commas to separate a quote from the tag line</h1><p id="a919"><b>Note: </b>A quote states exactly what the speaker said. A tag line explains the quote.</p><p id="4a93"><b>Examples:</b></p><p id="87a3">“The mayor,” stated Peter, “has brown hair.”</p><p id="5d53">Peter stated, “The Mayor has brown hair.”</p><p id="0faa">“The Mayor has brown hair,” stated Peter.</p><h1 id="2636">Rule 9: Use commas in dates, addresses, and numbers</h1><p id="00c4"><b>Examples:</b></p><p id="44b2">Friday, October 13, 1977</p><p id="5701">1334 Maple Road, William, New York 14221</p><p id="317a">12,000</p><p id="5f4c">These rules provide a simple list to save and reference when you are unsure about comma placement.</p><div id="0811" class="link-block">
<a href="https://bmahler-55533.medium.com/membership">
<div>
<div>
<h2>Join Medium with my referral link - Brenda Mahler</h2>
<div><h3>Read every story from Brenda Mahler (and thousands of other writers on Medium). Your membership fee directly supports…</h3></div>
<div><p>bmahler-55533.medium.com</p></div>
</div>
<div>
<div style="background-image: url(https://miro.readmedium.com/v2/resize:fit:320/0*NI3JeOLnl_ZBoZWf)"></div>
</div>
</div>
</a>
</div><h2 id="0eca">If you found this helpful, follow Strategies for Writing, a space for writers offering a series of posts in a question — answer format. Each article supports writers with inspiration and responses to questions you’ve always wondered about.</h2><h2 id="2d43">Posts require only 2–4 minutes to read so writers have time to write. Visit often!</h2></article></body>
Chapter 5: Importing JavaScript Code
A Complete Frontend Developer Textbook for Beginners (2023 Edition)
This lesson begins with a fresh Codepen. Open a new one and code along with me to increase retention!
Lecture
Just like there are three ways to include CSS code in our HTML document, there are also three waysto include JavaScript code which we cover in this lesson.
External JS
Similar to CSS, the first method is also called external.
Method 1: External JS
When we write our JavaScript code in this window on Codepen:
JS Window (Codepen 1):
console.log("hello world")
Console Window (Codepen 1):
"hello world"
We are really writing our JavaScript code into a separatefile.
The one we demonstrated was the onload event handler which we used to listen for the loadevent before executing our inline JavaScript code.
body => onload =>console.log(7)
Why would we use one method over another?
Just like CSS, each method has the samepros and cons.
In practice, external JavaScript is best because we can contain all the JavaScript code in one file which we can give to the Engineers in our team.
JS File => Engineers
Our Engineers can simply focus on and edit this one JavaScript file while our Designers and our Copywriters can focus on and edit the CSS file and the HTML file, respectively.
Copywriters: HTML file
Designers: CSS file
Engineers: JS file
Again, we want “separation of concerns” because this minimizes team members from editing the same files at the same time.
Finally, while CSS code is executed based on specificity, remember that JavaScript code is executed based on order of appearance (editor line order).
Execution:
CSS code => specificity
JS code => line order
Concept Quiz
Take my Programming Concept Quiz to check your understanding! For every correct choice, you will earn SW Coins which you can redeem for coupons towards the purchase of any of my Udemy courses!
Check out my Interactive Coding Exercises to put to practice what you have learned! There, you will also find interactive hints to help you understand each line of code. Likewise, for every correct solution, you will earn SW Coins which you can redeem for coupons towards the purchase of any of my Udemy courses!
Review what you have learned by playing my Syntax Flashcard Game! These flashcards are designed to help you commit to memory all the newcodesyntaxes you learned in this lesson.
Now that we have a basic understanding of how CSS code and JavaScript code interact with the HTML code, in Unit 2 our focus can center on learning about the latestHTML syntaxin depth. But as usual, even though the focus is on HTML, CSS and JavaScript are interleaved to deepen our understanding of their interrelationships.
For reference and inspiration, we will look at Flat’s beautifulhomepage. By the end of this Unit, you will know how to properly structure and layout a similar web page of your own!
Next Lesson
In the first lesson of this Unit, we will begin by learning how to properly layout a page using sectioningtags. And to make our HTML code fully semantic, we will also learn how to utilize subsectioningtags to organize some simple contenttags as examples. Find out why we should do this in the next lesson!
When you use my referral link above 👆 to become a Medium member, all proceeds will be donated towards the construction of the Silicon Wat Campus for children in Ukraine and Cambodia ❤️