Code Monkey home page Code Monkey logo

technophile's Introduction

Technophile

ECMAScript 5 Exercise on Multiple Inheritence

Multiple Inheritence in ECMAScript 5

All module files will be saved to lib/.
Each module will export a single class.

Install Dependencies

npm install

Run Tests

mocha -w

Create Classes

Phone

The constructor should accept a single argument phoneNumber, and set a public variable phoneNumber to the value of that constructor argument.

The class should define a callPhone method that accepts a single argument phoneNumber and return a status message. status message should be in the format: 'this phone number calls other phone number'
example: 5555555 calls 4444444

Tablet

The class should define a touch method that accepts two arguments x and y and return a literal object with keys x and y with values set to the method's arguments.

Game Console

The constructor should accept a single argument systemName, and set a public variable systemName to the value of that constructor argument.

The class should have a play method that accepts a single argument game and return a status message.
game is an object with a single key title with a value that's a string.
status message should be in the format: 'this system name plays the game object's title'
example: Jupiter Station plays Shynobie

Web Browser

The class should have an open method that accepts a single argument url and return a status message.
status message should be in the format: 'Browsing to url'
example: Browsing to http://reddit.com/r/aww

Watch

The constructor should set a public variable bodyPart to no value.

The class should have an wear method that accepts a single argument bodyPart and assign the value of that argument to this.bodyPart

Nintendo DS

This class inherits from the Game Console class and the Web Browser class.

The constructor should invoke the Game Console class constructor with the hard coded constructor argument 'Nintendo DS'

Smart Watch

This class inherits from the Watch class and the Tablet class.

The constructor should invoke the Watch class constructor.

Smart Phone

This class inherits from the Phone class, Tablet class, Game Console class, and the Web Browser class.

The constructor should accept a single argument phoneNumber and invoke the Phone class constructor passing in phoneNumber, and invoke the Game Console class constructor with the hard coded constructor argument 'Smart Phone'

technophile's People

Contributors

theremix avatar

Watchers

James Cloos avatar Eleazar Corpuz 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.