Objectives

Chapter 8: Manipulating Data in Strings and Arrays

  • Manipulate strings with properties and methods of the String object
  • Create regular expressions and use them to validate user input
  • Manipulate arrays with properties and methods of the Array object
  • Convert between strings and arrays, and between strings and JSON
Assignments and Due Dates
Assignments and Due Dates: View
Required Readings
Highly Recommended Tutorials

JSON Tutorials

  • JavaScript JSON Programming by Adam Khoury

I realize that these videos are a bit long. If you have time or need clarification, you might want to view or scan through them.

JSON Programming Tutorial 1 (16:09 min)
https://www.developphp.com/video/JavaScript/JSON-Tutorial-for-Beginners-Learn-How-to-Program

  • What is JSON? by Codesource
    Want to know more about JSON? Check out this four video series!https://www.youtube.com/playlist?list=PLfdtiltiRHWHKQOby9HEyYtB_Y9g7z6yL

      • What is JSON
        • Introduction (4:22 min)
        • Linting (1:38 min) Note: A site for linting" can be found at http://www.jslint.com/
        • Parsing (3:53 min) Note: This video might be more relevant in conjunction with the AJAX chapter.
        • Stringify (2:35 min)

      " Lint is the name originally given to a particular program that flagged some suspicious and non-portable constructs (likely to be bugs) in language source code. The term is now applied generically to tools that flag suspicious usage in software written in any computer language.

Sample Code

Completed sample code from Chapter 08    JS6eTextCode_Chapter08
Download the zip file and extract it.

 
Supplemental Materials
  1. PowerPoint from Text: CS2513GosselinJS_CH08 - View (ppt) | Print (pdf)
  2. You might want to bookmark these references for future use.
Software

Same software as previously indicated.

Chapter Questions and Test Reviews

Chapter Review Questions
Source for quiz and test questions. It is highly recommended that students know the answers.

Chapter 8: Review Questions (.rtf file)
Test 4: Review Sheet

Required Assignments

CSP08 - Strings and Arrays: Specifications
     (Complete, upload to Apollo1, then submit URL in the LMS)
Weekly Quiz: Chapter 8 (Located in the LMS)

Professor's Class Notes and Comments

There is a LOT of material this week. Be sure to start early and give it your full attention. Even though the chapter examples are not part of this week's assignment, "please" take the time to work through Glacier Rocks National Park.

JavaScript has many functions that can be used with strings and arrays. Take time to read the text, watch the videos, and work through the sample code to see how each of them operate. With that being said, allow ample time to learn about Regular Expressions. This is not a topic to be taken lightly. However, it is important and deserves our class time.

Students will be expected to create regular expressions both in the assignment and on the test.

Even though the assignment focuses on Regular Expressions, be sure you have a good understanding of the other concepts in the chapter. They will be used in future assignments....and, YES, they will be on the test!

P. 553

There are some online resources which should be helpful when creating regular expressions. RegExr allows code to be entered and tested interactively. Check it out! http://regexr.com/

The Regular Expression Cheat Sheet might also prove helpful. Click on the download link at the top if you with to save it in pdf or other formats, http://www.cheatography.com/davechild/cheat-sheets/regular-expressions

p. 593

The textbook gives a weird introduction to JSON. To put it into perspective, you might want to view some of the videos listed above. The topic will be visited again in the chapter on AJAX.

This chapter contains some powerful tools for writing JavaScript. I hope you take the time to make them part of your JavaScript knowledge base!