Skip to content

Latest commit

 

History

History
34 lines (30 loc) · 2.69 KB

INCLASS.md

File metadata and controls

34 lines (30 loc) · 2.69 KB

Lesson 2 In-Class Exercises

(As before, we’re not expecting you to finish all of these activities! Pick the ones which are interesting and challenging to you, and feel free to work with the people around you.)

JavaScript Concepts:

  • Break into groups of ~4 members. Each member is in charge of finding out about a specific javascript concept and writing a small jsfiddle that demonstrates it.
    • Come back together and give quick whiteboard talks within your group -- teach the rest of the group about your concept.
    • Concepts:
      • First-Class and Higher Order Functions
      • Prototypes/Inheritance
      • Bind, Apply, Call
      • Closures

Event Listeners:

  • Much of web development is learning to react to events. As a first foray into event handling, write a small jsfiddle like this that creates a simple html element and responds to an event of your choice. A list of possible events is available here.

Functional Programming:

  • Part of the power of JavaScript is that it is supports imperative (like C), object oriented (like C++ or Java), and functional (like Fortran or Lisp) programming paradigms. Its likely you've run into the first two through previous software classes, but if you are new to functional programming now is a great time to get an introduction
  • Read one or more of the following (in increasing order of read time):
  • Use what you learned (do some of the following):
    • Discuss what you learned with a partner
    • Come up with a simple task such as displaying the current time. Write two small jsfiddles to complete the task: one in an object-oriented fashion, the other in a functional one.
    • Read through and understand the documentation for some of JavaScript's functional tools (for instance, Array.prototype.map() and Array.prototype.reduce()) and practice using them in jsfiddle.

##Debugging Exercises

  • Try some or all of these exercises (Please fork the jsfiddles before editing them)
  • With a partner or small group...
    • Write a similar simple debugging exercise
    • Exchange them