Giter VIP home page Giter VIP logo

js-objects-prototypes's Issues

PVD Delivery

In place of this lesson, I delivered this DC lesson instead: https://github.com/ga-wdi-lessons/js-oojs-classes but started at the Classes section. I hadn't taught this lesson before, but I thought it'd be beneficial for them to have this one delivered because it makes use of ES6 classes. I did go over this http://www.w3schools.com/js/js_object_prototypes.asp with them so they could see how this was previously implemented.

  • For framing, I talked to them about how I showed them how to make and interact with object literals yesterday, but didn't make a compelling case for object oriented programming and how it makes our code more DRY because we were explicitly defining every civic, camry, mustang, etc. Enter classes, blah, blah, blah.

  • At this point in DC curriculum, they had a whole lesson on ES6 features so the code here made sense, but then I realized during the lesson that the PVD class hadn't seen template literals before, so I did have to detract a little bit to explain what that is. That's my bad.

  • Overall, I think the execution of this lesson went surprisingly well. Probably was my favorite so far. This class seemed to understand OOP much more easily than other classes I've seen.

Code snippet for superHero prototype code along

'use strict';// create a new superhero
const Hero = function (name, alias, power) {
  this.name = name;
  this.alias = alias;
  this._power = power;
};// assigning the new hero's attributes
let superMan = new Hero('Clark Kent', 'Superman', 'faster than a speeding bullet');let spiderMan = new Hero('Peter Parker', 'Spiderman', 'acts like a spider');// create a usePower method on the hero prototype (will use the superhero's power that is called)
Hero.prototype.usePower = function () {
  return this._power;
};// create a revealID method on the hero prototype (will reveal the superhero's real name that is called)
Hero.prototype.revealID = function () {
  return this.alias + 's real identity is ' + this.name + '!';
};

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.