WEEK 3: JavaScript Functions
(February 1-5)

To Do This Week:

CodeAcademy
Learn Javascript (look under “Syllabus”): “Functions”, “Scope”, “Arrays”, “Loops”

Read: Eloquent Javascript


Video Lectures:


Zoom Class

JavaScript and Text 
Taroko Gorge

Taper: an online literary magazine for small computational pieces

In-class Mini-project: Interactive text toy

mini-project-2 template – story-generator
mini-project-2 template – line scramble poem

Previous examples for mini-projects:
Mini-projects Fall 2020 


Zoom Workshop ( I will record this one)

Working with strings (manipulating text:

Regex (regular expressions) Basics:

// TO BREAK A LINE AFTER A PERIOD
// find all periods: \.
// replace with: \.\n

// TO ADD QUOTE AT START OF LINES
// find beginning of line: ^
// replace with: ”

// TO ADD QUOTE AND COMMA AT END OF LINES
// find end of line: $
// replace with: “,

// TO REMOVE ALL LINE BREAKS
// find: \n\s+
// replace with nothing

practice file

Poe text to play with


Notes:

JavaScript Talk:

Traversing the DOM (getting and manipulating elements on the page):