diff --git a/JavaScript Next Steps_handouts/headings/5.1.png b/JavaScript Next Steps_handouts/headings/5.1.png new file mode 100755 index 0000000..ff187d0 Binary files /dev/null and b/JavaScript Next Steps_handouts/headings/5.1.png differ diff --git a/JavaScript Next Steps_handouts/lesson5-1.md b/JavaScript Next Steps_handouts/lesson5-1.md new file mode 100755 index 0000000..d3c61ba --- /dev/null +++ b/JavaScript Next Steps_handouts/lesson5-1.md @@ -0,0 +1,15 @@ +![](headings/5.1.png) + +# Lesson Introduction + +In this lesson, I'm going to take you beyond **iteration**. We've all used loops before as part of our JavaScript programming. I introduced you to a lot of those loops in the beginning JavaScript class. + +# How Loops Work + +I want to take another look at how loops work and maybe see if there are some better approaches. To refresh your memories, we know a number of ways to iterate through data, and JavaScript provides a lot of options. They let you go through all of the items in an array or an object and even perform operations on those items while you're going through them. + +Some of the ones that we're probably most familiar with are the `for` statement, the "do while" statement, the `while` statement and even the "for in" statement. If any of these feel unfamiliar to you,it's probably a good idea to go back and double check that beginning JavaScript course just to make sure you're familiar with the basics. + +All of these looping systems are very convenient, but they also have some limitations. Some looping statements produce unexpected results and some of them don't work exactly the way that you'd expect them to or the way that you would want them to in certain situations. + +For example, `for` statements require you to define a lot of variables, because they require a lot of variables in order to work properly. "do while" statements perform an operation before doing any checks, and sometimes that's what you want, and sometimes that's not what you want. `while` statements test a condition that may not even be related to the operation. "for in" statements can produce unexpected results with arrays. And label, break, and continue encourage you to write code that can be confusing and difficult to follow. \ No newline at end of file diff --git a/JavaScript Next Steps_handouts/lesson5-1.pdf b/JavaScript Next Steps_handouts/lesson5-1.pdf new file mode 100755 index 0000000..23bd18b Binary files /dev/null and b/JavaScript Next Steps_handouts/lesson5-1.pdf differ diff --git a/readme.md b/readme.md index 669a706..664ad0d 100644 --- a/readme.md +++ b/readme.md @@ -1 +1,15 @@ -#Next-Steps-in-JavaScript +![](JavaScript Next Steps_handouts/headings/5.1.png) + +# Lesson Introduction + +In this lesson, I'm going to take you beyond **iteration**. We've all used loops before as part of our JavaScript programming. I introduced you to a lot of those loops in the beginning JavaScript class. + +# How Loops Work + +I want to take another look at how loops work and maybe see if there are some better approaches. To refresh your memories, we know a number of ways to iterate through data, and JavaScript provides a lot of options. They let you go through all of the items in an array or an object and even perform operations on those items while you're going through them. + +Some of the ones that we're probably most familiar with are the `for` statement, the "do while" statement, the `while` statement and even the "for in" statement. If any of these feel unfamiliar to you,it's probably a good idea to go back and double check that beginning JavaScript course just to make sure you're familiar with the basics. + +All of these looping systems are very convenient, but they also have some limitations. Some looping statements produce unexpected results and some of them don't work exactly the way that you'd expect them to or the way that you would want them to in certain situations. + +For example, `for` statements require you to define a lot of variables, because they require a lot of variables in order to work properly. "do while" statements perform an operation before doing any checks, and sometimes that's what you want, and sometimes that's not what you want. `while` statements test a condition that may not even be related to the operation. "for in" statements can produce unexpected results with arrays. And label, break, and continue encourage you to write code that can be confusing and difficult to follow. \ No newline at end of file