Giter Club home page Giter Club logo

oojs-social-distancing's Introduction

Alleviate Steven's Boredom During Social-Distancing

Being trapped indoors has me wanting for some new TV series to watch. Let's build something using Object Oriented JavaScript to make a playlist of stuff I should binge while social distancing.

Also, I watch a lot of TV so you're going to have to get creative...

You can use the boilerplate files to test your code.


  1. Create a TV Series class in JavaScript. It should initialize with the following properties: title, number of seasons, streaming service, genre, years.
  1. How is this being used above? What object does it reference?

  1. Create an instance method in the class called prettyPrint that returns a string formatted like this: Stranger Things, Science Fiction, 3 seasons, available on Netflix, 2016-2019
  1. Create an instance method that returns the following HTML. Give it an appropriate name.
<div>
  <h1>Stranger Things</h1>
  <h3>Science Fiction</h3>
  <p>3 Seasons</p>
  <p>2016-2019</p>
  <p>Netflix</p>
</div>
  1. Create an instance method called render that accepts a DOM node as an argument and appends the div from above onto it.
  1. Create a class method called all that returns all the TV Series that have been created. (Hint: how will you have to modify the constructor?)
  1. Write a function separate from the class that, when given an array of object literals representing TV Series, returns an array of pretty printed strings.
  1. Write a function separate from the class that will render all the TV series that have been created onto a page with the following HTML.
<div id="container"></div>
  1. What is a prototype? What purpose does it serve in JavaScript?

  1. What will be the return of the following expression? Why?
let strangerThings = new tvSeries({
  title: "Stranger Things", 
  numberOfSeason: 3, 
  service: "Netflix", 
  genre: "Science Fiction", years: "2016-2019"
  })

strangerThings.__proto__ === tvSeries.prototype // what will the return of this expression be?


I'm also getting into gaming during this period of isolation. Let's start building a role playing game for me to play while I'm bored.


  1. Let's shift our domain to video games. Create a Hero class with a constructor that accepts name, age, and damagePoints properites.
  1. Create a Warrior class that inherits from Hero. Its constructor should accept the same parameters as Hero in addition to weaponType (e.g., sword, battle axe, spear, club, etc.).
  1. Create a Mage class that inherits from Hero. Its constructor should accept the same parameters as Hero in addition to talisman (e.g., staff, wand, rabbit foot, I don't know...).

  1. Create a function that allows any given hero to attack an enemy. The function should return a string like this: Conan the Barbian has attacked you with a needlessly large sword! You have receive 10 damage points!. (Hint: Where will this method go? How will you make it work for any given subclass, including ones we might add in the future - e.g. dwarf, dark elf, baker, etc.)

oojs-social-distancing's People

Watchers

James Cloos 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.