Git Product home page Git Product logo

javascript-code-challenge-web-051517's Introduction

JavaScript Code Challenge

Objectives

  • Constructors / Prototypes or ES6 Classes
  • Callbacks
  • DOM Manipulation
  • Events and Event Handlers

Instructions

We're building out a commenting feature in our application with no persistence. A user should be able to create a new comment and have that comment be added into a comment list. The comment list can be filtered via keyword.

Note When creating constructors and prototypes, you may use ES6 classes or just create the constructor function separately. Your choice.

Deliverables

Part One - Create a solution utilizing jQuery only.

  1. Create a working solution in solution.js
  • The input field for comments/filter has been provided for you.

  • When submit button is clicked, comments should be added to a comment list. A new comment's text should appear in the ul with the id of "comments-list"

  • In a second input field, a user should be able to type a keyword and filter the same comments list based on that provided keyword.

    • filtering comments: if a comment does not contain the search term it should NOT be visible in the comment list

Part Two - Refactoring with Constructors and Prototypes (feel free to use either ES5 or ES6)

  1. Create new files comment.js anad commentList.js
  2. Create a JS class / constructor for a Comment. New comments should initialize with some text.
  3. Instances of comments should have a prototype method called 'render' that returns a string of an li with that comment's text inside.
  4. Create a class / constructor for a CommentList. New comment lists should have a comments array. The initializer should be able to take an array of strings and convert them to comments
  5. Instances of CommentList should have a method called 'render' that returns a string of a ul. Inside of the ul, the comment list should include the return value of the render method of all of it's comments.
  6. Instances of CommentList should have a method called 'addComment' that takes in a string. It should instantiate a new Comment and add it to the CommentList's array of comments.

javascript-code-challenge-web-051517's People

Contributors

ipc103 avatar jmburges avatar joll59 avatar

Watchers

James Cloos avatar Chris D'Ascoli 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.