Code Monkey home page Code Monkey logo

custom-for-each's Introduction

A Custom Version of forEach for Sake of Learning

Why a custom function that works like forEach?

So we can better conceptualize how forEach works

Instructions

Follow the process we learned in https://github.com/SummerOfCode2020/week-04-forking-from-the-org

First

  • Fork
  • Clone your personal copy to your local
  • cd into the project
  • Run npm install
  • Note there were no dependencies for this project
  • Run npm start to see the output

Next Use the Debugger

  • In VS Code, add a breakpoint to line 66 in custom-for-each.js
  • In VS Code, Open package.json
  • Click the "Debug" icon that is above the scripts property
  • Select to debug the start script when prompted
  • Note the variables and the iteration logic we can see in the debugger
  • Click the play button for Continue. F8 is the shortcut key as another option
  • Note the changing variables
  • Repeat clicking Continue to see each iteration and it's variables

Then Change the Breakpoint

  • Remove previously set breakpoints
  • Add a breakpoint to line 102
  • Run the debugger again
  • Note the variables
  • Click the play button for Continue
  • Note the changing variables
  • Repeat clicking Continue to see each iteration and it's variables

Finally

We will plan to cover this in class to see how we can use this to understand what forEach does.

Master the forEach

custom-for-each's People

Contributors

johnny-rice avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.