WEEK 4: Javascript Array Methods and Iterators
(February 8-12)

To Do This Week:

CodeAcademy
Learn Javascript (look under “Syllabus”): “Iterators”, “Objects”

Read: Eloquent Javascript:


Video Lectures:


Zoom Class

What Thing Are You Quiz?  (functions and for loop)

Vote example
Scale example
Complex example


Zoom Workshop

General Help: Syntax, Concepts, Problem Solving


Notes:

JavaScript and the DOM
traversing
event listener
dom events
dom style reference

innerHTML = “some text”;
innerHTML += “some more text”;

Array Methods:

pop(); // remove the last element of an array:
push(); // add a new item to an array:
shift(); // remove the first item of an array:
unshift(); // add new items to the beginning of an array:
splice(); // adds/removes items to/from an array, and returns the removed item(s)
sort(), reverse() // the sort() method sorts an array alphabetically, and sets number arrays to ascending or descending
slice(); // returns the selected elements in an array, as a new array object.

Iterators:

forEach(); // calls a provided function once for each element in an array, in order
findIndex();  // returns the index of the first element in an array that pass a test (provided as a function)
filter(); // creates an array filled with all array elements that pass a test (provided as a function).
map(); // creates a new array with the results of calling a function for every array element.
some(); // checks if any of the elements in an array pass a test (provided as a function).
every(); // method checks if all elements in an array pass a test (provided as a function)
reduce(); // method reduces the array to a single value

Switch vs Conditionals 

JavaScript Quiz Study Guide
complete JavaScript CodeAcademy

 

E-Lit Project (10%) DUE Tuesday Feb 23rd

Program and design your own generative poem or story using some of the text  manipulation techniques you have learned.